Changeset View
Changeset View
Standalone View
Standalone View
kded/gtkconfig.cpp
Show All 21 Lines | |||||
22 | #include <QFont> | 22 | #include <QFont> | ||
23 | #include <QDBusConnection> | 23 | #include <QDBusConnection> | ||
24 | #include <QDBusMessage> | 24 | #include <QDBusMessage> | ||
25 | #include <QGuiApplication> | 25 | #include <QGuiApplication> | ||
26 | 26 | | |||
27 | #include <KIconLoader> | 27 | #include <KIconLoader> | ||
28 | #include <KPluginFactory> | 28 | #include <KPluginFactory> | ||
29 | #include <KConfigWatcher> | 29 | #include <KConfigWatcher> | ||
30 | #include <KColorScheme> | ||||
30 | 31 | | |||
31 | #include "gtkconfig.h" | 32 | #include "gtkconfig.h" | ||
32 | #include "configvalueprovider.h" | 33 | #include "configvalueprovider.h" | ||
33 | #include "themepreviewer.h" | 34 | #include "themepreviewer.h" | ||
34 | 35 | | |||
35 | K_PLUGIN_CLASS_WITH_JSON(GtkConfig, "gtkconfig.json") | 36 | K_PLUGIN_CLASS_WITH_JSON(GtkConfig, "gtkconfig.json") | ||
36 | 37 | | |||
37 | GtkConfig::GtkConfig(QObject *parent, const QVariantList&) : | 38 | GtkConfig::GtkConfig(QObject *parent, const QVariantList&) : | ||
▲ Show 20 Lines • Show All 139 Lines • ▼ Show 20 Line(s) | 177 | { | |||
177 | const QString enableAnimations = configValueProvider->enableAnimations(); | 178 | const QString enableAnimations = configValueProvider->enableAnimations(); | ||
178 | ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-enable-animations"), enableAnimations); | 179 | ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-enable-animations"), enableAnimations); | ||
179 | // FIXME work with booleans in configValueProvider... | 180 | // FIXME work with booleans in configValueProvider... | ||
180 | ConfigEditor::setGtk3ConfigValueDconf(QStringLiteral("enable-animations"), enableAnimations == QLatin1String("1")); | 181 | ConfigEditor::setGtk3ConfigValueDconf(QStringLiteral("enable-animations"), enableAnimations == QLatin1String("1")); | ||
181 | ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-enable-animations"), enableAnimations); | 182 | ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-enable-animations"), enableAnimations); | ||
182 | ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/EnableAnimations"), enableAnimations); | 183 | ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/EnableAnimations"), enableAnimations); | ||
183 | } | 184 | } | ||
184 | 185 | | |||
186 | void GtkConfig::setColors() const | ||||
187 | { | ||||
188 | const QMap<QString, QColor> colors = configValueProvider->colors(); | ||||
189 | ConfigEditor::setGtk3Colors(colors); | ||||
190 | } | ||||
191 | | ||||
185 | void GtkConfig::applyAllSettings() const | 192 | void GtkConfig::applyAllSettings() const | ||
186 | { | 193 | { | ||
187 | setFont(); | 194 | setFont(); | ||
188 | setIconTheme(); | 195 | setIconTheme(); | ||
189 | setCursorTheme(); | 196 | setCursorTheme(); | ||
190 | setIconsOnButtons(); | 197 | setIconsOnButtons(); | ||
191 | setIconsInMenus(); | 198 | setIconsInMenus(); | ||
192 | setToolbarStyle(); | 199 | setToolbarStyle(); | ||
193 | setScrollbarBehavior(); | 200 | setScrollbarBehavior(); | ||
194 | setDarkThemePreference(); | 201 | setDarkThemePreference(); | ||
195 | setWindowDecorationsButtonsOrder(); | 202 | setWindowDecorationsButtonsOrder(); | ||
196 | setEnableAnimations(); | 203 | setEnableAnimations(); | ||
204 | setColors(); | ||||
197 | } | 205 | } | ||
198 | 206 | | |||
199 | void GtkConfig::onKdeglobalsSettingsChange(const KConfigGroup &group, const QByteArrayList &names) const | 207 | void GtkConfig::onKdeglobalsSettingsChange(const KConfigGroup &group, const QByteArrayList &names) const | ||
200 | { | 208 | { | ||
201 | if (group.name() == QStringLiteral("KDE")) { | 209 | if (group.name() == QStringLiteral("KDE")) { | ||
202 | if (names.contains(QByteArrayLiteral("AnimationDurationFactor"))) { | 210 | if (names.contains(QByteArrayLiteral("AnimationDurationFactor"))) { | ||
203 | setEnableAnimations(); | 211 | setEnableAnimations(); | ||
204 | } | 212 | } | ||
Show All 10 Lines | 222 | } else if (group.name() == QStringLiteral("Icons")) { | |||
215 | if (names.contains(QByteArrayLiteral("Theme"))) { | 223 | if (names.contains(QByteArrayLiteral("Theme"))) { | ||
216 | setIconTheme(); | 224 | setIconTheme(); | ||
217 | } | 225 | } | ||
218 | } else if (group.name() == QStringLiteral("General")) { | 226 | } else if (group.name() == QStringLiteral("General")) { | ||
219 | if (names.contains(QByteArrayLiteral("font"))) { | 227 | if (names.contains(QByteArrayLiteral("font"))) { | ||
220 | setFont(); | 228 | setFont(); | ||
221 | } | 229 | } | ||
222 | if (names.contains(QByteArrayLiteral("ColorScheme"))) { | 230 | if (names.contains(QByteArrayLiteral("ColorScheme"))) { | ||
231 | setColors(); | ||||
223 | setDarkThemePreference(); | 232 | setDarkThemePreference(); | ||
224 | } | 233 | } | ||
225 | } else if (group.name() == QStringLiteral("Toolbar style")) { | 234 | } else if (group.name() == QStringLiteral("Toolbar style")) { | ||
226 | if (names.contains(QByteArrayLiteral("ToolButtonStyle"))) { | 235 | if (names.contains(QByteArrayLiteral("ToolButtonStyle"))) { | ||
227 | setToolbarStyle(); | 236 | setToolbarStyle(); | ||
228 | } | 237 | } | ||
229 | } | 238 | } | ||
230 | } | 239 | } | ||
Show All 19 Lines |