diff --git a/platformtheme/hintsettings.cpp b/platformtheme/hintsettings.cpp index c760055..8363a1c 100644 --- a/platformtheme/hintsettings.cpp +++ b/platformtheme/hintsettings.cpp @@ -31,7 +31,14 @@ HintsSettings::HintsSettings(QObject *parent) : QObject(parent), m_settings(new QSettings(QSettings::UserScope, "cutefishos", "theme")) { - m_hints[QPlatformTheme::SystemIconThemeName] = darkMode() ? s_darkIconName : s_lightIconName; + m_iconTheme = m_settings->value("IconTheme", "Crule").toString(); + + if (m_iconTheme.contains("Crule")) + m_hints[QPlatformTheme::SystemIconThemeName] = darkMode() ? s_darkIconName : s_lightIconName; + else + m_hints[QPlatformTheme::SystemIconThemeName] = m_iconTheme; + + m_hints[QPlatformTheme::SystemIconFallbackThemeName] = s_lightIconName; m_hints[QPlatformTheme::StyleNames] = "cutefish"; m_hints[QPlatformTheme::SystemIconFallbackThemeName] = QStringLiteral("hicolor"); m_hints[QPlatformTheme::IconThemeSearchPaths] = xdgIconThemePaths(); @@ -114,7 +121,17 @@ void HintsSettings::onFileChanged(const QString &path) else if (value == s_darkModeName) { emit darkModeChanged(newValue.toBool()); // Need to update the icon to dark - m_hints[QPlatformTheme::SystemIconThemeName] = darkMode() ? s_darkIconName : s_lightIconName; + + if (m_iconTheme.contains("Crule")) + m_hints[QPlatformTheme::SystemIconThemeName] = darkMode() ? s_darkIconName : s_lightIconName; + + emit iconThemeChanged(); + } else if (value == "IconTheme") { + if (!m_iconTheme.contains("Crule")) { + m_iconTheme = newValue.toString(); + m_hints[QPlatformTheme::SystemIconThemeName] = m_iconTheme; + } + emit iconThemeChanged(); } } diff --git a/platformtheme/hintsettings.h b/platformtheme/hintsettings.h index 8c72f3b..5e2c08d 100644 --- a/platformtheme/hintsettings.h +++ b/platformtheme/hintsettings.h @@ -52,6 +52,7 @@ private: QString m_systemFont; QString m_systemFixedFont; qreal m_systemFontPointSize; + QString m_iconTheme; }; #endif //HINTSSETTINGS_H diff --git a/platformtheme/platformtheme.cpp b/platformtheme/platformtheme.cpp index 4796609..e6a7c0f 100644 --- a/platformtheme/platformtheme.cpp +++ b/platformtheme/platformtheme.cpp @@ -45,7 +45,8 @@ extern void updateXdgIconSystemTheme(); void onDarkModeChanged() { if (qApp->applicationName() == "systemsettings" - || qApp->applicationName().contains("plasma")) { + || qApp->applicationName().contains("plasma") + || qApp->applicationName().contains("QtCreator")) { return; }