From f4cbe5199ba906bed38bdb8317ffed9431321e40 Mon Sep 17 00:00:00 2001 From: Martin Rotter Date: Fri, 12 Nov 2021 10:08:08 +0100 Subject: [PATCH] change order of loading of palette and qss --- src/librssguard/miscellaneous/skinfactory.cpp | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/librssguard/miscellaneous/skinfactory.cpp b/src/librssguard/miscellaneous/skinfactory.cpp index b2e5e2da4..8baa62a1f 100644 --- a/src/librssguard/miscellaneous/skinfactory.cpp +++ b/src/librssguard/miscellaneous/skinfactory.cpp @@ -47,16 +47,6 @@ bool SkinFactory::isStyleGoodForDarkVariant(const QString& style_name) const { } void SkinFactory::loadSkinFromData(const Skin& skin) { - if (!skin.m_rawData.isEmpty()) { - if (qApp->styleSheet().simplified().isEmpty()) { - qApp->setStyleSheet(skin.m_rawData); - } - else { - qCriticalNN << LOGSEC_GUI - << "Skipped setting of application style and skin because there is already some style set."; - } - } - QString style_name = qApp->settings()->value(GROUP(GUI), SETTING(GUI::Style)).toString(); qApp->setStyle(style_name); @@ -85,7 +75,7 @@ void SkinFactory::loadSkinFromData(const Skin& skin) { fusion_palette.setColor(QPalette::ColorRole::Dark, clr_bg); fusion_palette.setColor(QPalette::ColorRole::AlternateBase, clr_altbg); fusion_palette.setColor(QPalette::ColorRole::Button, clr_altbg); - fusion_palette.setColor(QPalette::ColorRole::Highlight, clr_selbg); + fusion_palette.setColor(QPalette::ColorRole::Highlight, Qt::GlobalColor::blue); // Texts. fusion_palette.setColor(QPalette::ColorRole::WindowText, clr_fg); @@ -97,6 +87,14 @@ void SkinFactory::loadSkinFromData(const Skin& skin) { fusion_palette.setColor(QPalette::ColorRole::LinkVisited, clr_link); fusion_palette.setColor(QPalette::ColorRole::HighlightedText, clr_fg); + // + // Inactive state. + // + + // Backgrounds & bases. + + // Texts. + // // Disabled state. // @@ -129,6 +127,16 @@ void SkinFactory::loadSkinFromData(const Skin& skin) { QToolTip::setPalette(fusion_palette); qApp->setPalette(fusion_palette); } + + if (!skin.m_rawData.isEmpty()) { + if (qApp->styleSheet().simplified().isEmpty()) { + qApp->setStyleSheet(skin.m_rawData); + } + else { + qCriticalNN << LOGSEC_GUI + << "Skipped setting of application style and skin because there is already some style set."; + } + } } void SkinFactory::setCurrentSkinName(const QString& skin_name) {