Changeset View
Changeset View
Standalone View
Standalone View
src/plasma/private/theme_p.cpp
Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Line(s) | 55 | : QObject(parent), | |||
---|---|---|---|---|---|
70 | isDefault(true), | 70 | isDefault(true), | ||
71 | useGlobal(true), | 71 | useGlobal(true), | ||
72 | hasWallpapers(false), | 72 | hasWallpapers(false), | ||
73 | fixedName(false), | 73 | fixedName(false), | ||
74 | backgroundContrast(qQNaN()), | 74 | backgroundContrast(qQNaN()), | ||
75 | backgroundIntensity(qQNaN()), | 75 | backgroundIntensity(qQNaN()), | ||
76 | backgroundSaturation(qQNaN()), | 76 | backgroundSaturation(qQNaN()), | ||
77 | backgroundContrastEnabled(true), | 77 | backgroundContrastEnabled(true), | ||
78 | blurBehindEnabled(true), | ||||
78 | apiMajor(1), | 79 | apiMajor(1), | ||
79 | apiMinor(0), | 80 | apiMinor(0), | ||
80 | apiRevision(0) | 81 | apiRevision(0) | ||
81 | { | 82 | { | ||
82 | ThemeConfig config; | 83 | ThemeConfig config; | ||
83 | cacheTheme = config.cacheTheme(); | 84 | cacheTheme = config.cacheTheme(); | ||
84 | 85 | | |||
85 | pixmapSaveTimer = new QTimer(this); | 86 | pixmapSaveTimer = new QTimer(this); | ||
▲ Show 20 Lines • Show All 645 Lines • ▼ Show 20 Line(s) | 728 | if (metadata->hasGroup("ContrastEffect")) { | |||
731 | backgroundContrast = cg.readEntry("contrast", qQNaN()); | 732 | backgroundContrast = cg.readEntry("contrast", qQNaN()); | ||
732 | backgroundIntensity = cg.readEntry("intensity", qQNaN()); | 733 | backgroundIntensity = cg.readEntry("intensity", qQNaN()); | ||
733 | backgroundSaturation = cg.readEntry("saturation", qQNaN()); | 734 | backgroundSaturation = cg.readEntry("saturation", qQNaN()); | ||
734 | } else { | 735 | } else { | ||
735 | backgroundContrastEnabled = false; | 736 | backgroundContrastEnabled = false; | ||
736 | } | 737 | } | ||
737 | } | 738 | } | ||
738 | 739 | | |||
740 | void ThemePrivate::processBlurBehindSettings(KConfigBase *metadata) | ||||
741 | { | ||||
742 | KConfigGroup cg; | ||||
743 | if (metadata->hasGroup("BlurBehindEffect")) { | ||||
744 | cg = KConfigGroup(metadata, "BlurBehindEffect"); | ||||
745 | blurBehindEnabled = cg.readEntry("enabled", true); | ||||
746 | } else { | ||||
747 | blurBehindEnabled = true; | ||||
748 | } | ||||
749 | } | ||||
750 | | ||||
739 | void ThemePrivate::setThemeName(const QString &tempThemeName, bool writeSettings, bool emitChanged) | 751 | void ThemePrivate::setThemeName(const QString &tempThemeName, bool writeSettings, bool emitChanged) | ||
740 | { | 752 | { | ||
741 | QString theme = tempThemeName; | 753 | QString theme = tempThemeName; | ||
742 | if (theme.isEmpty() || theme == themeName) { | 754 | if (theme.isEmpty() || theme == themeName) { | ||
743 | // let's try and get the default theme at least | 755 | // let's try and get the default theme at least | ||
744 | if (themeName.isEmpty()) { | 756 | if (themeName.isEmpty()) { | ||
745 | theme = QLatin1String(ThemePrivate::defaultTheme); | 757 | theme = QLatin1String(ThemePrivate::defaultTheme); | ||
746 | } else { | 758 | } else { | ||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | |||||
795 | 807 | | |||
796 | // load the wallpaper settings, if any | 808 | // load the wallpaper settings, if any | ||
797 | if (realTheme) { | 809 | if (realTheme) { | ||
798 | const QString metadataPath(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1Literal(PLASMA_RELATIVE_DATA_INSTALL_DIR "/desktoptheme/") % theme % QLatin1Literal("/metadata.desktop"))); | 810 | const QString metadataPath(QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1Literal(PLASMA_RELATIVE_DATA_INSTALL_DIR "/desktoptheme/") % theme % QLatin1Literal("/metadata.desktop"))); | ||
799 | KConfig metadata(metadataPath, KConfig::SimpleConfig); | 811 | KConfig metadata(metadataPath, KConfig::SimpleConfig); | ||
800 | pluginInfo = KPluginInfo(metadataPath); | 812 | pluginInfo = KPluginInfo(metadataPath); | ||
801 | 813 | | |||
802 | processContrastSettings(&metadata); | 814 | processContrastSettings(&metadata); | ||
815 | processBlurBehindSettings(&metadata); | ||||
803 | 816 | | |||
804 | processWallpaperSettings(&metadata); | 817 | processWallpaperSettings(&metadata); | ||
805 | 818 | | |||
806 | KConfigGroup cg(&metadata, "Settings"); | 819 | KConfigGroup cg(&metadata, "Settings"); | ||
807 | QString fallback = cg.readEntry("FallbackTheme", QString()); | 820 | QString fallback = cg.readEntry("FallbackTheme", QString()); | ||
808 | 821 | | |||
809 | fallbackThemes.clear(); | 822 | fallbackThemes.clear(); | ||
810 | while (!fallback.isEmpty() && !fallbackThemes.contains(fallback)) { | 823 | while (!fallback.isEmpty() && !fallbackThemes.contains(fallback)) { | ||
▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines |