aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-theme-engine/src
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2017-08-03 14:03:29 -0400
committerKen Moore <ken@ixsystems.com>2017-08-03 14:04:05 -0400
commit4530400268bf9a8749513e69a7bfb574fca20f09 (patch)
tree7e0e4cd58253f896d6371d7adad04c5a5809deb8 /src-qt5/core/lumina-theme-engine/src
parentGet the icon loading routines all switched over to the old QIcon::fromTheme()... (diff)
downloadlumina-4530400268bf9a8749513e69a7bfb574fca20f09.tar.gz
lumina-4530400268bf9a8749513e69a7bfb574fca20f09.tar.bz2
lumina-4530400268bf9a8749513e69a7bfb574fca20f09.zip
Cleanup some fallback routines for loading icons from the Qt theme methods.
Diffstat (limited to 'src-qt5/core/lumina-theme-engine/src')
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.cpp21
-rw-r--r--src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.h2
2 files changed, 18 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 9d6c9bea..453bde1d 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
@@ -70,7 +70,7 @@ QPlatformSystemTrayIcon *lthemeenginePlatformTheme::createPlatformSystemTrayIcon
QDBusMenuConnection conn;
m_dbusTrayAvailable = conn.isStatusNotifierHostRegistered();
m_checkDBusTray = false;
- qCDebug(llthemeengine) << "D-Bus system tray:" << (m_dbusTrayAvailable ? "yes" : "no");
+ //qCDebug(llthemeengine) << "D-Bus system tray:" << (m_dbusTrayAvailable ? "yes" : "no");
}
return (m_dbusTrayAvailable ? new QDBusTrayIcon() : nullptr);
}
@@ -177,10 +177,10 @@ void lthemeenginePlatformTheme::readSettings(){
settings.beginGroup("Appearance");
m_style = settings.value("style", "Fusion").toString();
if(settings.value("custom_palette", false).toBool()){
- QString schemePath = settings.value("color_scheme_path").toString();
+ QString schemePath = settings.value("color_scheme_path","airy").toString();
m_customPalette = new QPalette(loadColorScheme(schemePath));
}
- m_iconTheme = settings.value("icon_theme").toString();
+ m_iconTheme = settings.value("icon_theme", "material-design-light").toString();
settings.endGroup();
settings.beginGroup("Fonts");
m_generalFont = settings.value("general", QPlatformTheme::font(QPlatformTheme::SystemFont)).value<QFont>();
@@ -237,7 +237,20 @@ QString lthemeenginePlatformTheme::loadStyleSheets(const QStringList &paths){
return content;
}
-QPalette lthemeenginePlatformTheme::loadColorScheme(const QString &filePath){
+QPalette lthemeenginePlatformTheme::loadColorScheme(QString filePath){
+ if(!filePath.contains("/") && !filePath.endsWith(".conf") && !filePath.isEmpty()){
+ //relative theme name, auto-complete it
+ QStringList dirs;
+ dirs << getenv("XDG_CONFIG_HOME");
+ dirs << QString(getenv("XDG_CONFIG_DIRS")).split(":");
+ dirs << QString(getenv("XDG_DATA_DIRS")).split(":");
+ QString relpath = "/lthemeengine/colors/%1.conf";
+ relpath = relpath.arg(filePath);
+ for(int i=0; i<dirs.length(); i++){
+ if(QFile::exists(dirs[i]+relpath)){ filePath = dirs[i]+relpath; break; }
+ }
+ }
+
QPalette customPalette;
QSettings settings(filePath, QSettings::IniFormat);
settings.beginGroup("ColorScheme");
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 5313b73e..17323328 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
@@ -65,7 +65,7 @@ private:
bool hasWidgets();
#endif
QString loadStyleSheets(const QStringList &paths);
- QPalette loadColorScheme(const QString &filePath);
+ QPalette loadColorScheme(QString filePath);
QString m_style, m_iconTheme, m_userStyleSheet, m_prevStyleSheet;
QPalette *m_customPalette = nullptr;
QFont m_generalFont, m_fixedFont;
bgstack15