diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,5 +66,6 @@ add_subdirectory(gtk3proxies) add_subdirectory(icons) add_subdirectory(tests) +add_subdirectory(kded-module) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/kded-module/CMakeLists.txt b/kded-module/CMakeLists.txt new file mode 100644 --- /dev/null +++ b/kded-module/CMakeLists.txt @@ -0,0 +1,35 @@ +find_package(KF5DBusAddons) + +set(kscreen_daemon_SRCS + gtkconfig.cpp + configeditor.cpp + configvalueprovider.cpp +) + +add_library(gtkconfig MODULE ${kscreen_daemon_SRCS}) + +target_compile_definitions(gtkconfig + PUBLIC + -DQT_NO_SIGNALS_SLOTS_KEYWORDS +) + +target_include_directories(gtkconfig + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} + ${GTK3_INCLUDE_DIRS} +) + +target_link_libraries(gtkconfig + Qt5::Gui + Qt5::DBus + KF5::CoreAddons + KF5::ConfigCore + KF5::DBusAddons + KF5::IconThemes + ${GIO2_LIBRARY} + ${GLIB2_LIBRARY} + ${GTK3_LIBRARY} + ${GOBJECT2_LIBRARY} +) + +install(TARGETS gtkconfig DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/kded) diff --git a/kded-module/configeditor.h b/kded-module/configeditor.h new file mode 100644 --- /dev/null +++ b/kded-module/configeditor.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2019 Mikhail Zolotukhin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License or (at your option) version 3 or any later version + * accepted by the membership of KDE e.V. (or its successor approved + * by the membership of KDE e.V.), which shall act as a proxy + * defined in Section 14 of version 3 of the license. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#pragma once + +#include + +class QString; +class QFile; + +class ConfigEditor +{ +public: + ConfigEditor() = default; + + void setGtk2ConfigValue(const QString ¶mName, const QString ¶mValue) const; + void setGtk3ConfigValueDconf(const QString ¶mName, const QString ¶mValue) const; + void setGtk3ConfigValueSettingsIni(const QString ¶mName, const QString ¶mValue) const; + void setGtk3ConfigValueXSettingsd(const QString ¶mName, const QString ¶mValue) const; + +private: + void replaceValueInGtkrcContents(QString >krcContents, const QString ¶mName, const QString ¶mValue) const; + void replaceValueInXSettingsdContents(QString &xSettingsdContents, const QString ¶mName, const QString ¶mValue) const; + + void reloadGtk2Apps() const; + void reloadXSettingsd() const; + + QString readFileContents(QFile >krc) const; + pid_t getPidOfXSettingsd() const; +}; diff --git a/kded-module/configeditor.cpp b/kded-module/configeditor.cpp new file mode 100644 --- /dev/null +++ b/kded-module/configeditor.cpp @@ -0,0 +1,171 @@ +/* + * Copyright (C) 2019 Mikhail Zolotukhin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License or (at your option) version 3 or any later version + * accepted by the membership of KDE e.V. (or its successor approved + * by the membership of KDE e.V.), which shall act as a proxy + * defined in Section 14 of version 3 of the license. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include + +#include "configeditor.h" + +void ConfigEditor::setGtk3ConfigValueDconf(const QString ¶mName, const QString ¶mValue) const +{ + gtk_init(nullptr, nullptr); + g_autoptr(GSettings) gsettings = g_settings_new("org.gnome.desktop.interface"); + g_settings_set_string(gsettings, paramName.toUtf8().constData(), paramValue.toUtf8().constData()); +} + +void ConfigEditor::setGtk3ConfigValueSettingsIni(const QString ¶mName, const QString ¶mValue) const +{ + QString configLocation(QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation)); + QString gtk3ConfigPath(configLocation + "/gtk-3.0/settings.ini"); + + KSharedConfig::Ptr gtk3Config = KSharedConfig::openConfig(gtk3ConfigPath, KConfig::NoGlobals); + KConfigGroup group(gtk3Config, QStringLiteral("Settings")); + + group.writeEntry(paramName, paramValue); + group.sync(); +} + +void ConfigEditor::setGtk3ConfigValueXSettingsd(const QString ¶mName, const QString ¶mValue) const +{ + using qsp = QStandardPaths; + QString configLocation(qsp::writableLocation(qsp::GenericConfigLocation)); + + QDir xsettingsdPath(configLocation + "/xsettingsd"); + if (!xsettingsdPath.exists()) { + xsettingsdPath.mkpath("."); + } + + QString xSettingsdConfigPath(xsettingsdPath.path() + "/xsettingsd.conf"); + + QFile xSettingsdConfig(xSettingsdConfigPath); + QString xSettingsdConfigContents(readFileContents(xSettingsdConfig)); + replaceValueInXSettingsdContents(xSettingsdConfigContents, paramName, paramValue); + xSettingsdConfig.remove(); + xSettingsdConfig.open(QIODevice::WriteOnly | QIODevice::Text); + xSettingsdConfig.write(xSettingsdConfigContents.toUtf8()); + reloadXSettingsd(); +} + +void ConfigEditor::setGtk2ConfigValue(const QString ¶mName, const QString ¶mValue) const +{ + QString gtkrcPath(QDir::homePath() + "/.gtkrc-2.0"); + QFile gtkrc(gtkrcPath); + QString gtkrcContents(readFileContents(gtkrc)); + replaceValueInGtkrcContents(gtkrcContents, paramName, paramValue); + gtkrc.remove(); + gtkrc.open(QIODevice::WriteOnly | QIODevice::Text); + gtkrc.write(gtkrcContents.toUtf8()); + reloadGtk2Apps(); +} + +QString ConfigEditor::readFileContents(QFile &file) const +{ + if (file.open(QIODevice::ReadWrite | QIODevice::Text)) { + return file.readAll(); + } else { + return ""; + } +} + +void ConfigEditor::replaceValueInGtkrcContents(QString >krcContents, const QString ¶mName, const QString ¶mValue) const +{ + const QRegularExpression regExp(paramName + "=[^\n]*($|\n)"); + + static const QStringList nonStringProperties{ + QStringLiteral("gtk-toolbar-style"), + QStringLiteral("gtk-menu-images"), + QStringLiteral("gtk-button-images"), + QStringLiteral("gtk-primary-button-warps-slider"), + }; + + QString newConfigString; + if (nonStringProperties.contains(paramName)) { + newConfigString = paramName + "=" + paramValue + "\n"; + } else { + newConfigString = paramName + "=\"" + paramValue + "\"\n"; + } + + if (gtkrcContents.contains(regExp)) { + gtkrcContents.replace(regExp, newConfigString); + } else { + gtkrcContents = newConfigString + "\n" + gtkrcContents; + } +} + +void ConfigEditor::replaceValueInXSettingsdContents(QString &xSettingsdContents, const QString ¶mName, const QString ¶mValue) const +{ + const QRegularExpression regExp(paramName + " [^\n]*($|\n)"); + + static const QStringList nonStringProperties{ + QStringLiteral("Gtk/ButtonImages"), + QStringLiteral("Gtk/MenuImages"), + QStringLiteral("Gtk/ToolbarStyle"), + }; + + QString newConfigString; + if (nonStringProperties.contains(paramName)) { + newConfigString = paramName + " " + paramValue + "\n"; + } else { + newConfigString = paramName + " \"" + paramValue + "\"\n"; + } + + if (xSettingsdContents.contains(regExp)) { + xSettingsdContents.replace(regExp, newConfigString); + } else { + xSettingsdContents = newConfigString + "\n" + xSettingsdContents; + } +} + +void ConfigEditor::reloadGtk2Apps() const +{ + QProcess::startDetached(QStandardPaths::findExecutable(QStringLiteral("reload_gtk_apps"))); +} + +void ConfigEditor::reloadXSettingsd() const +{ + pid_t pidOfXSettingsd(getPidOfXSettingsd()); + if (pidOfXSettingsd == 0) { + QProcess::startDetached(QStandardPaths::findExecutable(QStringLiteral("xsettingsd"))); + } else { + kill(pidOfXSettingsd, SIGHUP); + } +} + +pid_t ConfigEditor::getPidOfXSettingsd() const +{ + QProcess pidof{}; + pidof.start("pidof", QStringList() << "-s" << "xsettingsd"); + pidof.waitForFinished(); + QString xsettingsdPid(QString(pidof.readAllStandardOutput()).remove('\n')); + return xsettingsdPid.toInt(); +} diff --git a/kded-module/configvalueprovider.h b/kded-module/configvalueprovider.h new file mode 100644 --- /dev/null +++ b/kded-module/configvalueprovider.h @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2019 Mikhail Zolotukhin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License or (at your option) version 3 or any later version + * accepted by the membership of KDE e.V. (or its successor approved + * by the membership of KDE e.V.), which shall act as a proxy + * defined in Section 14 of version 3 of the license. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +class QString; +class QFont; + +class ConfigValueProvider +{ +public: + enum class ToolbarStyleNotation { + Xsettingsd = 0, + SettingsIni, + Dconf + }; + + ConfigValueProvider() = default; + + QString getConfigFontName() const; + QString getConfigIconThemeName() const; + QString getConfigCursorThemeName() const; + QString getIconsOnButtonsConfigValue() const; + QString getIconsInMenusConfigValue() const; + QString getToolbarStyle(ToolbarStyleNotation notation) const; + +private: + QString getToolbarStyleInDesiredNotation(const QString &kdeConfigValue, ToolbarStyleNotation notation) const; + +}; diff --git a/kded-module/configvalueprovider.cpp b/kded-module/configvalueprovider.cpp new file mode 100644 --- /dev/null +++ b/kded-module/configvalueprovider.cpp @@ -0,0 +1,112 @@ +/* + * Copyright (C) 2019 Mikhail Zolotukhin + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License or (at your option) version 3 or any later version + * accepted by the membership of KDE e.V. (or its successor approved + * by the membership of KDE e.V.), which shall act as a proxy + * defined in Section 14 of version 3 of the license. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include +#include +#include +#include + +#include "configvalueprovider.h" + +QString ConfigValueProvider::getConfigFontName() const +{ + static const QFont defaultFont(QStringLiteral("Noto Sans"), 10); + + KSharedConfigPtr config(KSharedConfig::openConfig(QStringLiteral("kdeglobals"))); + KConfigGroup configGroup(config->group(QStringLiteral("General"))); + QFont font = configGroup.readEntry(QStringLiteral("font"), defaultFont); + return font.family() + ' ' + font.styleName() + ' ' + QString::number(font.pointSize()); +} + +QString ConfigValueProvider::getConfigIconThemeName() const +{ + KIconTheme *newIconTheme(KIconLoader::global()->theme()); + if (newIconTheme == nullptr) { + return QStringLiteral("breeze"); + } else { + return newIconTheme->internalName(); + } +} + +QString ConfigValueProvider::getConfigCursorThemeName() const +{ + KSharedConfigPtr config(KSharedConfig::openConfig(QStringLiteral("kcminputrc"))); + KConfigGroup configGroup(config->group(QStringLiteral("Mouse"))); + return configGroup.readEntry(QStringLiteral("cursorTheme")); +} + +QString ConfigValueProvider::getIconsOnButtonsConfigValue() const +{ + KSharedConfigPtr config(KSharedConfig::openConfig(QStringLiteral("kdeglobals"), KConfig::NoGlobals)); + KConfigGroup configGroup(config->group(QStringLiteral("KDE"))); + bool kdeConfigValue(configGroup.readEntry(QStringLiteral("ShowIconsOnPushButtons"), true)); + + if (kdeConfigValue) { + return QStringLiteral("1"); + } else { + return QStringLiteral("0"); + } +} + +QString ConfigValueProvider::getIconsInMenusConfigValue() const +{ + KSharedConfigPtr config(KSharedConfig::openConfig(QStringLiteral("kdeglobals"), KConfig::NoGlobals)); + KConfigGroup configGroup(config->group(QStringLiteral("KDE"))); + bool kdeConfigValue(configGroup.readEntry(QStringLiteral("ShowIconsInMenuItems"), true)); + + if (kdeConfigValue) { + return QStringLiteral("1"); + } else { + return QStringLiteral("0"); + } +} + +QString ConfigValueProvider::getToolbarStyle(ConfigValueProvider::ToolbarStyleNotation notation) const +{ + KSharedConfigPtr config(KSharedConfig::openConfig(QStringLiteral("kdeglobals"), KConfig::NoGlobals)); + KConfigGroup configGroup(config->group(QStringLiteral("Toolbar style"))); + QString kdeConfigValue(configGroup.readEntry(QStringLiteral("ToolButtonStyle"), "TextBesideIcon")); + return getToolbarStyleInDesiredNotation(kdeConfigValue, notation); +} + +QString ConfigValueProvider::getToolbarStyleInDesiredNotation(const QString &kdeConfigValue, ConfigValueProvider::ToolbarStyleNotation notation) const +{ + QStringList toolbarStyles; + if (notation == ToolbarStyleNotation::SettingsIni) { + toolbarStyles.append({"GTK_TOOLBAR_ICONS", "GTK_TOOLBAR_TEXT", "GTK_TOOLBAR_BOTH_HORIZ", "GTK_TOOLBAR_BOTH"}); + } else if (notation == ToolbarStyleNotation::Xsettingsd) { + toolbarStyles.append({"0", "1", "3", "2"}); + } else { + toolbarStyles.append({"icons", "text", "both-horiz", "both"}); + } + + if (kdeConfigValue == QStringLiteral("NoText")) { + return toolbarStyles[0]; + } else if (kdeConfigValue == QStringLiteral("TextOnly")) { + return toolbarStyles[1]; + } else if (kdeConfigValue == QStringLiteral("TextBesideIcon")) { + return toolbarStyles[2]; + } else { + return toolbarStyles[3]; + } +} diff --git a/kded-module/gtkconfig.h b/kded-module/gtkconfig.h new file mode 100644 --- /dev/null +++ b/kded-module/gtkconfig.h @@ -0,0 +1,74 @@ +/* + * Copyright (C) 2019 Mikhail Zolotukhin + * Copyright (C) 2019 Nicolas Fella + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License or (at your option) version 3 or any later version + * accepted by the membership of KDE e.V. (or its successor approved + * by the membership of KDE e.V.), which shall act as a proxy + * defined in Section 14 of version 3 of the license. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include + +#include "configeditor.h" +#include "configvalueprovider.h" + +class Q_DECL_EXPORT GtkConfig : public KDEDModule +{ + Q_OBJECT + + enum class SettingsChangeType { + Palette = 0, + Font, + Style, + Settings, + Icon, + Cursor, + ToolbarStyle, + BlockShortcuts, + NaturalSorting + }; + + enum class SettingsCategory { + Mouse, + Completion, + Paths, + Popupmenu, + Qt, + Shortcuts, + Locale, + Style + }; + +public: + GtkConfig(QObject *parent, const QVariantList& args); + + void setFont() const; + void setIconTheme(int iconGroup) const; + void setCursorTheme() const; + void setIconsOnButtons() const; + void setIconsInMenus() const; + void setToolbarStyle() const; + + void applyAllSettings() const; + +public Q_SLOTS: + void onGlobalSettingsChange(int settingsChangeType, int arg) const; + +private: + QScopedPointer configValueProvider; + QScopedPointer configEditor; +}; diff --git a/kded-module/gtkconfig.cpp b/kded-module/gtkconfig.cpp new file mode 100644 --- /dev/null +++ b/kded-module/gtkconfig.cpp @@ -0,0 +1,138 @@ +/* + * Copyright (C) 2019 Mikhail Zolotukhin + * Copyright (C) 2019 Nicolas Fella + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License or (at your option) version 3 or any later version + * accepted by the membership of KDE e.V. (or its successor approved + * by the membership of KDE e.V.), which shall act as a proxy + * defined in Section 14 of version 3 of the license. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include + +#include +#include + +#include "gtkconfig.h" +#include "configvalueprovider.h" + +K_PLUGIN_CLASS_WITH_JSON(GtkConfig, "gtkconfig.json") + +GtkConfig::GtkConfig(QObject *parent, const QVariantList&) : + KDEDModule(parent), + configValueProvider(new ConfigValueProvider()), + configEditor(new ConfigEditor()) +{ + connect(qGuiApp, &QGuiApplication::fontChanged, this, &GtkConfig::setFont); + connect(KIconLoader::global(), &KIconLoader::iconChanged, this, &GtkConfig::setIconTheme); + QDBusConnection::sessionBus().connect(QString(), + QStringLiteral("/KGlobalSettings"), + QStringLiteral("org.kde.KGlobalSettings"), + QStringLiteral("notifyChange"), + this, + SLOT(onGlobalSettingsChange(int,int))); + + applyAllSettings(); +} + +void GtkConfig::setFont() const +{ + const QString configFontName(configValueProvider->getConfigFontName()); + configEditor->setGtk2ConfigValue(QStringLiteral("gtk-font-name"), configFontName); + configEditor->setGtk3ConfigValueDconf(QStringLiteral("font-name"), configFontName); + configEditor->setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-font-name"), configFontName); + configEditor->setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/FontName"), configFontName); +} + +void GtkConfig::setIconTheme(int iconGroup) const +{ + if (iconGroup == KIconLoader::Group::Desktop) { // This is needed to update icons only once + const QString iconThemeName(configValueProvider->getConfigIconThemeName()); + configEditor->setGtk2ConfigValue(QStringLiteral("gtk-icon-theme-name"), iconThemeName); + configEditor->setGtk3ConfigValueDconf(QStringLiteral("icon-theme"), iconThemeName); + configEditor->setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-icon-theme-name"), iconThemeName); + configEditor->setGtk3ConfigValueXSettingsd(QStringLiteral("Net/IconThemeName"), iconThemeName); + } +} + +void GtkConfig::setCursorTheme() const +{ + const QString cursorThemeName(configValueProvider->getConfigCursorThemeName()); + configEditor->setGtk2ConfigValue(QStringLiteral("gtk-cursor-theme-name"), cursorThemeName); + configEditor->setGtk3ConfigValueDconf(QStringLiteral("cursor-theme"), cursorThemeName); + configEditor->setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-cursor-theme-name"), cursorThemeName); + configEditor->setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/CursorThemeName"), cursorThemeName); +} + +void GtkConfig::setIconsOnButtons() const +{ + const QString iconsOnButtonsConfigValue(configValueProvider->getIconsOnButtonsConfigValue()); + configEditor->setGtk2ConfigValue(QStringLiteral("gtk-button-images"), iconsOnButtonsConfigValue); + configEditor->setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-button-images"), iconsOnButtonsConfigValue); + configEditor->setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/ButtonImages"), iconsOnButtonsConfigValue); +} + +void GtkConfig::setIconsInMenus() const +{ + const QString iconsInMenusConfigValue(configValueProvider->getIconsInMenusConfigValue()); + configEditor->setGtk2ConfigValue(QStringLiteral("gtk-menu-images"), iconsInMenusConfigValue); + configEditor->setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-menu-images"), iconsInMenusConfigValue); + configEditor->setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/MenuImages"), iconsInMenusConfigValue); +} + +void GtkConfig::setToolbarStyle() const +{ + using ToolbarStyleNotation = ConfigValueProvider::ToolbarStyleNotation; + + QString toolbarStyleSettingsFile(configValueProvider->getToolbarStyle(ToolbarStyleNotation::SettingsIni)); + QString toolbarStyleDConf(configValueProvider->getToolbarStyle(ToolbarStyleNotation::Dconf)); + QString toolbarStyleXSettingsd(configValueProvider->getToolbarStyle(ToolbarStyleNotation::Xsettingsd)); + + configEditor->setGtk2ConfigValue(QStringLiteral("gtk-toolbar-style"), toolbarStyleSettingsFile); + configEditor->setGtk3ConfigValueDconf(QStringLiteral("toolbar-style"), toolbarStyleDConf); + configEditor->setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-toolbar-style"), toolbarStyleSettingsFile); + configEditor->setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/ToolbarStyle"), toolbarStyleXSettingsd); +} + +void GtkConfig::applyAllSettings() const +{ + setFont(); + setFont(); + setIconTheme(KIconLoader::Group::Desktop); + setCursorTheme(); + setIconsOnButtons(); + setIconsInMenus(); + setToolbarStyle(); +} + +void GtkConfig::onGlobalSettingsChange(int settingsChangeType, int arg) const +{ + SettingsChangeType changeType(static_cast(settingsChangeType)); + SettingsCategory settingsCategory(static_cast(arg)); + + if (changeType == SettingsChangeType::Cursor) { + setCursorTheme(); + } else if (changeType == SettingsChangeType::Settings && settingsCategory == SettingsCategory::Style) { + // Since KGlobalSettings::ChangeType::ToolbarStyleChanged is not working, + // we use the style settings category as a whole to change the respective settings + setIconsOnButtons(); + setIconsInMenus(); + setToolbarStyle(); + } +} +#include "gtkconfig.moc" + diff --git a/kded-module/gtkconfig.json b/kded-module/gtkconfig.json new file mode 100644 --- /dev/null +++ b/kded-module/gtkconfig.json @@ -0,0 +1,15 @@ +{ + "KPlugin": { + "Description": "GTK config management", + "Icon": "preferences-system-power-management", + "Name": "Plasma GTKd", + "ServiceTypes": [ + "KDEDModule" + ], + "Version": "0.1" + }, + "X-KDE-Kded-autoload": true, + "X-KDE-Kded-load-on-demand": false, + "X-KDE-Kded-phase": 1 +} +