diff options
author | Ken Moore <ken@ixsystems.com> | 2017-09-18 12:55:58 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-09-18 12:55:58 -0400 |
commit | c04fc4bd19594886fb9ff51dd3ba4b8145cd1765 (patch) | |
tree | 118a688a06a68dcdf539613c15d78abfdc6a2854 /src-qt5/core/lumina-theme-engine/src | |
parent | Make sure we never overwrite an application's stylesheet if one is set. (diff) | |
download | lumina-c04fc4bd19594886fb9ff51dd3ba4b8145cd1765.tar.gz lumina-c04fc4bd19594886fb9ff51dd3ba4b8145cd1765.tar.bz2 lumina-c04fc4bd19594886fb9ff51dd3ba4b8145cd1765.zip |
Cleanup the stylesheet usage on apps a bit more.
Still apply any application styles if the app has it's own global stylesheet, but put the additional styles earlier in the priority so the app stylesheet has priority over any conflicting rules.
Diffstat (limited to 'src-qt5/core/lumina-theme-engine/src')
-rw-r--r-- | src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.cpp | 8 |
1 files changed, 4 insertions, 4 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 934d2234..670e1c9c 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 @@ -133,10 +133,10 @@ void lthemeenginePlatformTheme::applySettings(){ else{ qApp->setPalette(qApp->style()->standardPalette()); } } //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; - } + QString orig = qApp->styleSheet(); + if(orig.startsWith(m_oldStyleSheet)){ orig = orig.remove(m_oldStyleSheet); } + qApp->setStyleSheet(m_userStyleSheet+orig); //make sure the app style has higher priority than ours + m_oldStyleSheet = m_userStyleSheet; } #endif |