aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-theme-engine/src
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-09-18 12:26:29 -0400
committerKen Moore <ken@ixsystems.com>2017-09-18 12:26:29 -0400
commit6afa54c0af62552e30b61e0236706fd6403d2760 (patch)
treeee0335226ad1ce008eb23114afa389f5ed050c47 /src-qt5/core/lumina-theme-engine/src
parentA few more tweaks for the theme engine. (diff)
downloadlumina-6afa54c0af62552e30b61e0236706fd6403d2760.tar.gz
lumina-6afa54c0af62552e30b61e0236706fd6403d2760.tar.bz2
lumina-6afa54c0af62552e30b61e0236706fd6403d2760.zip
Make sure we never overwrite an application's stylesheet if one is set.
Diffstat (limited to 'src-qt5/core/lumina-theme-engine/src')
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.cpp10
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.h2
2 files changed, 7 insertions, 5 deletions
diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.cpp b/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.cpp
index 545cce9f..934d2234 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.cpp
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.cpp
@@ -132,10 +132,12 @@ void lthemeenginePlatformTheme::applySettings(){
if(m_customPalette){ qApp->setPalette(*m_customPalette); }
else{ qApp->setPalette(qApp->style()->standardPalette()); }
}
- //do not override application style
- qApp->setStyleSheet(m_userStyleSheet);
- //else{ qCDebug(llthemeengine) << "custom style sheet is disabled";}
- //m_prevStyleSheet = m_userStyleSheet;
+ //do not override application style if one is already set by the app itself
+ if(qApp->styleSheet().isEmpty() || qApp->styleSheet()==m_oldStyleSheet){
+ qApp->setStyleSheet(m_userStyleSheet);
+ m_oldStyleSheet = m_userStyleSheet;
+ }
+
}
#endif
QGuiApplication::setFont(m_generalFont); //apply font
diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.h b/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.h
index 3bc9ebbf..f521d457 100644
--- a/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.h
+++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.h
@@ -66,7 +66,7 @@ private:
#endif
QString loadStyleSheets(const QStringList &paths);
QPalette loadColorScheme(QString filePath);
- QString m_style, m_iconTheme, m_userStyleSheet, m_cursorTheme;
+ QString m_style, m_iconTheme, m_userStyleSheet, m_oldStyleSheet, m_cursorTheme;
QPalette *m_customPalette = nullptr;
QFont m_generalFont, m_fixedFont;
int m_doubleClickInterval;
bgstack15