diff --git a/GUI/Support/Style/ApplicationSettings.cpp b/GUI/Support/Style/ApplicationSettings.cpp index 6de34db9f625dea347af9f2372acd364d01d9d8b..37dcec24763d3795c1cb0dc852e18485c5aea865 100644 --- a/GUI/Support/Style/ApplicationSettings.cpp +++ b/GUI/Support/Style/ApplicationSettings.cpp @@ -160,32 +160,32 @@ void ApplicationSettings::loadStyle(ApplicationSettings::Style style) } m_currentStyle = style; - m_styleSheetPalette = qApp->style()->standardPalette(); + QPalette styleSheetPalette = qApp->style()->standardPalette(); // -- init palette for later usage; could be improved by parsing the stylesheet switch (m_currentStyle) { case ApplicationSettings::Style::light: { - m_styleSheetPalette.setColor(QPalette::Text, Qt::black); - m_styleSheetPalette.setColor(QPalette::WindowText, Qt::black); - m_styleSheetPalette.setColor(QPalette::Base, Qt::white); - m_styleSheetPalette.setColor(QPalette::AlternateBase, QColor(255, 255, 255).darker(105)); - m_styleSheetPalette.setColor(QPalette::Dark, QColor(255, 255, 255).darker(110)); + styleSheetPalette.setColor(QPalette::Text, Qt::black); + styleSheetPalette.setColor(QPalette::WindowText, Qt::black); + styleSheetPalette.setColor(QPalette::Base, Qt::white); + styleSheetPalette.setColor(QPalette::AlternateBase, QColor(255, 255, 255).darker(105)); + styleSheetPalette.setColor(QPalette::Dark, QColor(255, 255, 255).darker(110)); break; } case ApplicationSettings::Style::dark: { - m_styleSheetPalette.setColor(QPalette::Text, QColor(213, 220, 223)); - m_styleSheetPalette.setColor(QPalette::WindowText, QColor(213, 220, 223)); - m_styleSheetPalette.setColor(QPalette::Base, QColor(43, 50, 54)); - m_styleSheetPalette.setColor(QPalette::AlternateBase, QColor(43, 50, 54).darker(130)); - m_styleSheetPalette.setColor(QPalette::Dark, QColor(43, 50, 54).darker(120)); + styleSheetPalette.setColor(QPalette::Text, QColor(213, 220, 223)); + styleSheetPalette.setColor(QPalette::WindowText, QColor(213, 220, 223)); + styleSheetPalette.setColor(QPalette::Base, QColor(43, 50, 54)); + styleSheetPalette.setColor(QPalette::AlternateBase, QColor(43, 50, 54).darker(130)); + styleSheetPalette.setColor(QPalette::Dark, QColor(43, 50, 54).darker(120)); break; } default: { - m_styleSheetPalette = qApp->style()->standardPalette(); + styleSheetPalette = qApp->style()->standardPalette(); break; } } - QApplication::setPalette(m_styleSheetPalette); + QApplication::setPalette(styleSheetPalette); qApp->setStyleSheet(""); qApp->setStyleSheet(stylesheet); } diff --git a/GUI/Support/Style/ApplicationSettings.h b/GUI/Support/Style/ApplicationSettings.h index 39933aa419fef519dca645972b326e5e20843cf7..11fc9610b2662d7fa89fbda440aa37fc2e522759 100644 --- a/GUI/Support/Style/ApplicationSettings.h +++ b/GUI/Support/Style/ApplicationSettings.h @@ -57,7 +57,6 @@ public: private: ApplicationSettings::Style m_currentStyle; - QPalette m_styleSheetPalette; }; extern ApplicationSettings* appSettings; //!< global pointer to the single instance