diff options
author | Ken Moore <ken@ixsystems.com> | 2017-09-18 11:10:08 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-09-18 11:10:08 -0400 |
commit | 39f54ac1bdfa1865516dfebd07ab52fe58e5e998 (patch) | |
tree | 220e4e109d8492ab677dffc94fb4b1e467725115 /src-qt5 | |
parent | Fix up the icon sync on theme change, and change the icon for lumina-mediapla... (diff) | |
download | lumina-39f54ac1bdfa1865516dfebd07ab52fe58e5e998.tar.gz lumina-39f54ac1bdfa1865516dfebd07ab52fe58e5e998.tar.bz2 lumina-39f54ac1bdfa1865516dfebd07ab52fe58e5e998.zip |
A few more tweaks for the theme engine.
Try to update application window icons when the theme changes.
Minor change to the Glass desktop theme.
Diffstat (limited to 'src-qt5')
-rw-r--r-- | src-qt5/core/lumina-theme-engine/desktop_qss/Glass.qss | 2 | ||||
-rw-r--r-- | src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.cpp | 16 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src-qt5/core/lumina-theme-engine/desktop_qss/Glass.qss b/src-qt5/core/lumina-theme-engine/desktop_qss/Glass.qss index 1bfa92cd..502c0a44 100644 --- a/src-qt5/core/lumina-theme-engine/desktop_qss/Glass.qss +++ b/src-qt5/core/lumina-theme-engine/desktop_qss/Glass.qss @@ -1,5 +1,5 @@ QWidget#LuminaBootSplash{ - background: qradialgradient(spread:reflect, cx:0.113757, cy:0.875, radius:0.7, fx:0.045, fy:0.954545, stop:0 palette(light), stop:1 palette(midlight) ); + background: qradialgradient(spread:reflect, cx:0.113757, cy:0.875, radius:0.7, fx:0.045, fy:0.954545, stop:0 palette(base), stop:1 palette(light) ); border-radius: 5px; } 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 a65798de..545cce9f 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 @@ -139,7 +139,19 @@ void lthemeenginePlatformTheme::applySettings(){ } #endif QGuiApplication::setFont(m_generalFont); //apply font + bool ithemechange = m_iconTheme != QIcon::themeName(); QIcon::setThemeName(m_iconTheme); //apply icons + //See if we need to reload the application icon from the new theme + if(ithemechange){ + QString appIcon = qApp->windowIcon().name(); + if(!appIcon.isEmpty() && QIcon::hasThemeIcon(appIcon)){ qApp->setWindowIcon(QIcon::fromTheme(appIcon)); } + QWindowList wins = qApp->topLevelWindows(); + for(int i=0; i<wins.length(); i++){ + QString winIcon = wins[i]->icon().name(); + if(!winIcon.isEmpty() && QIcon::hasThemeIcon(winIcon)){ wins[i]->setIcon(QIcon::fromTheme(winIcon)); } + } + } + bool cthemechange = m_cursorTheme != QString(getenv("X_CURSOR_THEME")); setenv("X_CURSOR_THEME", m_cursorTheme.toLocal8Bit().data(), 1); //qDebug() << "Icon Theme Change:" << m_iconTheme << QIcon::themeSearchPaths(); if(m_customPalette && m_usePalette){ QGuiApplication::setPalette(*m_customPalette); } //apply palette @@ -148,8 +160,8 @@ void lthemeenginePlatformTheme::applySettings(){ QEvent et(QEvent::ThemeChange); QEvent ec(QEvent::CursorChange); foreach (QWidget *w, qApp->allWidgets()){ - QApplication::sendEvent(w, &et); - QApplication::sendEvent(w, &ec); + if(ithemechange){ QApplication::sendEvent(w, &et); } + if(cthemechange){ QApplication::sendEvent(w, &ec); } } } #endif |