diff --git a/ProfileInterface.cpp b/ProfileInterface.cpp index 2351e20..dc06c4b 100644 --- a/ProfileInterface.cpp +++ b/ProfileInterface.cpp @@ -51,7 +51,6 @@ #include #include #include -#include #include #include #include @@ -1588,7 +1587,7 @@ void ProfileInterface::contextMenuTriggeredPIC(QContextMenuEvent *ev) { previousWidget->setStyleSheet(QLatin1String("")); } - picWidget->setStyleSheet(QString("QFrame#SnapmaticFrame{background-color: rgb(%1, %2, %3)}QLabel#labPicStr{color: rgb(%4, %5, %6)}").arg(QString::number(highlightBackColor.red()), QString::number(highlightBackColor.green()), QString::number(highlightBackColor.blue()), QString::number(highlightTextColor.red()), QString::number(highlightTextColor.green()), QString::number(highlightTextColor.blue()))); + picWidget->setStyleSheet(QString("QFrame#SnapmaticFrame{background-color:palette(highlight)}QLabel#labPicStr{color:palette(highlighted-text)}")); previousWidget = picWidget; } QMenu contextMenu(picWidget); @@ -1639,7 +1638,7 @@ void ProfileInterface::contextMenuTriggeredSGD(QContextMenuEvent *ev) { previousWidget->setStyleSheet(QLatin1String("")); } - sgdWidget->setStyleSheet(QString("QFrame#SavegameFrame{background-color: rgb(%1, %2, %3)}QLabel#labSavegameStr{color: rgb(%4, %5, %6)}").arg(QString::number(highlightBackColor.red()), QString::number(highlightBackColor.green()), QString::number(highlightBackColor.blue()), QString::number(highlightTextColor.red()), QString::number(highlightTextColor.green()), QString::number(highlightTextColor.blue()))); + sgdWidget->setStyleSheet(QString("QFrame#SavegameFrame{background-color:palette(highlight)}QLabel#labSavegameStr{color:palette(highlighted-text)}")); previousWidget = sgdWidget; } QMenu contextMenu(sgdWidget); @@ -1757,7 +1756,7 @@ bool ProfileInterface::eventFilter(QObject *watched, QEvent *event) { if (pWidget != previousWidget) { - pWidget->setStyleSheet(QString("QFrame#SnapmaticFrame{background-color: rgb(%1, %2, %3)}QLabel#labPicStr{color: rgb(%4, %5, %6)}").arg(QString::number(highlightBackColor.red()), QString::number(highlightBackColor.green()), QString::number(highlightBackColor.blue()), QString::number(highlightTextColor.red()), QString::number(highlightTextColor.green()), QString::number(highlightTextColor.blue()))); + pWidget->setStyleSheet(QString("QFrame#SnapmaticFrame{background-color:palette(highlight)}QLabel#labPicStr{color:palette(highlighted-text)}")); styleSheetChanged = true; } } @@ -1765,7 +1764,7 @@ bool ProfileInterface::eventFilter(QObject *watched, QEvent *event) { if (pWidget != previousWidget) { - pWidget->setStyleSheet(QString("QFrame#SavegameFrame{background-color: rgb(%1, %2, %3)}QLabel#labSavegameStr{color: rgb(%4, %5, %6)}").arg(QString::number(highlightBackColor.red()), QString::number(highlightBackColor.green()), QString::number(highlightBackColor.blue()), QString::number(highlightTextColor.red()), QString::number(highlightTextColor.green()), QString::number(highlightTextColor.blue()))); + pWidget->setStyleSheet(QString("QFrame#SavegameFrame{background-color:palette(highlight)}QLabel#labSavegameStr{color:palette(highlighted-text)}")); styleSheetChanged = true; } } @@ -1802,7 +1801,7 @@ bool ProfileInterface::eventFilter(QObject *watched, QEvent *event) { if (pWidget != previousWidget) { - pWidget->setStyleSheet(QString("QFrame#SnapmaticFrame{background-color: rgb(%1, %2, %3)}QLabel#labPicStr{color: rgb(%4, %5, %6)}").arg(QString::number(highlightBackColor.red()), QString::number(highlightBackColor.green()), QString::number(highlightBackColor.blue()), QString::number(highlightTextColor.red()), QString::number(highlightTextColor.green()), QString::number(highlightTextColor.blue()))); + pWidget->setStyleSheet(QString("QFrame#SnapmaticFrame{background-color:palette(highlight)}QLabel#labPicStr{color:palette(highlighted-text)}")); styleSheetChanged = true; } } @@ -1810,7 +1809,7 @@ bool ProfileInterface::eventFilter(QObject *watched, QEvent *event) { if (pWidget != previousWidget) { - pWidget->setStyleSheet(QString("QFrame#SavegameFrame{background-color: rgb(%1, %2, %3)}QLabel#labSavegameStr{color: rgb(%4, %5, %6)}").arg(QString::number(highlightBackColor.red()), QString::number(highlightBackColor.green()), QString::number(highlightBackColor.blue()), QString::number(highlightTextColor.red()), QString::number(highlightTextColor.green()), QString::number(highlightTextColor.blue()))); + pWidget->setStyleSheet(QString("QFrame#SavegameFrame{background-color:palette(highlight)}QLabel#labSavegameStr{color:palette(highlighted-text)}")); styleSheetChanged = true; } } @@ -1878,7 +1877,7 @@ void ProfileInterface::hoverProfileWidgetCheck() { if (pWidget != previousWidget) { - pWidget->setStyleSheet(QString("QFrame#SnapmaticFrame{background-color: rgb(%1, %2, %3)}QLabel#labPicStr{color: rgb(%4, %5, %6)}").arg(QString::number(highlightBackColor.red()), QString::number(highlightBackColor.green()), QString::number(highlightBackColor.blue()), QString::number(highlightTextColor.red()), QString::number(highlightTextColor.green()), QString::number(highlightTextColor.blue()))); + pWidget->setStyleSheet(QString("QFrame#SnapmaticFrame{background-color:palette(highlight)}QLabel#labPicStr{color:palette(highlighted-text)}")); styleSheetChanged = true; } } @@ -1886,7 +1885,7 @@ void ProfileInterface::hoverProfileWidgetCheck() { if (pWidget != previousWidget) { - pWidget->setStyleSheet(QString("QFrame#SavegameFrame{background-color: rgb(%1, %2, %3)}QLabel#labSavegameStr{color: rgb(%4, %5, %6)}").arg(QString::number(highlightBackColor.red()), QString::number(highlightBackColor.green()), QString::number(highlightBackColor.blue()), QString::number(highlightTextColor.red()), QString::number(highlightTextColor.green()), QString::number(highlightTextColor.blue()))); + pWidget->setStyleSheet(QString("QFrame#SavegameFrame{background-color:palette(highlight)}QLabel#labSavegameStr{color:palette(highlighted-text)}")); styleSheetChanged = true; } } @@ -1911,20 +1910,16 @@ void ProfileInterface::hoverProfileWidgetCheck() void ProfileInterface::updatePalette() { - QPalette palette; - QColor baseColor = palette.base().color(); - highlightBackColor = palette.highlight().color(); - highlightTextColor = palette.highlightedText().color(); - ui->saProfile->setStyleSheet(QString("QWidget#saProfileContent{background-color: rgb(%1, %2, %3)}").arg(QString::number(baseColor.red()), QString::number(baseColor.green()), QString::number(baseColor.blue()))); + ui->saProfile->setStyleSheet(QString("QWidget#saProfileContent{background-color:palette(base)}")); if (previousWidget != nullptr) { if (previousWidget->getWidgetType() == "SnapmaticWidget") { - previousWidget->setStyleSheet(QString("QFrame#SnapmaticFrame{background-color: rgb(%1, %2, %3)}QLabel#labPicStr{color: rgb(%4, %5, %6)}").arg(QString::number(highlightBackColor.red()), QString::number(highlightBackColor.green()), QString::number(highlightBackColor.blue()), QString::number(highlightTextColor.red()), QString::number(highlightTextColor.green()), QString::number(highlightTextColor.blue()))); + previousWidget->setStyleSheet(QString("QFrame#SnapmaticFrame{background-color:palette(highlight)}QLabel#labPicStr{color:palette(highlighted-text)}")); } else if (previousWidget->getWidgetType() == "SavegameWidget") { - previousWidget->setStyleSheet(QString("QFrame#SavegameFrame{background-color: rgb(%1, %2, %3)}QLabel#labSavegameStr{color: rgb(%4, %5, %6)}").arg(QString::number(highlightBackColor.red()), QString::number(highlightBackColor.green()), QString::number(highlightBackColor.blue()), QString::number(highlightTextColor.red()), QString::number(highlightTextColor.green()), QString::number(highlightTextColor.blue()))); + previousWidget->setStyleSheet(QString("QFrame#SnapmaticFrame{background-color:palette(highlight)}QLabel#labPicStr{color:palette(highlighted-text)}")); } } } diff --git a/ProfileInterface.h b/ProfileInterface.h index 980c317..795b8a9 100644 --- a/ProfileInterface.h +++ b/ProfileInterface.h @@ -101,8 +101,6 @@ private: QMap widgets; QSpacerItem *saSpacerItem; QStringList fixedPictures; - QColor highlightBackColor; - QColor highlightTextColor; QString enabledPicStr; QString profileFolder; QString profileName; diff --git a/SavegameWidget.cpp b/SavegameWidget.cpp index 2289250..d85a4ba 100644 --- a/SavegameWidget.cpp +++ b/SavegameWidget.cpp @@ -58,7 +58,7 @@ SavegameWidget::SavegameWidget(QWidget *parent) : qreal screenRatio = AppEnv::screenRatio(); ui->labSavegamePic->setFixedSize(48 * screenRatio, 27 * screenRatio); - QPixmap savegamePixmap(":/img/savegame.png"); + QPixmap savegamePixmap(":/img/savegame.svgz"); if (screenRatio != 1) savegamePixmap = savegamePixmap.scaledToHeight(ui->labSavegamePic->height(), Qt::SmoothTransformation); ui->labSavegamePic->setPixmap(savegamePixmap); diff --git a/res/app.qrc b/res/app.qrc index 551b5f7..4e74981 100644 --- a/res/app.qrc +++ b/res/app.qrc @@ -19,7 +19,7 @@ pointmaker-16.png pointmaker-24.png pointmaker-32.png - savegame.png + savegame.svgz watermark_1b.png watermark_2b.png watermark_2r.png diff --git a/res/savegame.png b/res/savegame.png deleted file mode 100644 index 90988fa..0000000 Binary files a/res/savegame.png and /dev/null differ diff --git a/res/savegame.svgz b/res/savegame.svgz new file mode 100644 index 0000000..a1c8247 Binary files /dev/null and b/res/savegame.svgz differ