Commit 8359e316 authored by Mikhail Zolotukhin's avatar Mikhail Zolotukhin
Browse files

Synchronize the cursor size setting

BUG: 421133
parent 4446d9b8
......@@ -22,7 +22,7 @@ The daemon itself does the following:
- 🔤 UI Font
- 💾 Icon Theme
- 👆 Cursor Theme
- 👆 Cursor theme and size
- 🆗 Icons on Buttons (Show them or not)
- 🗒 Icons in Menus (Show them or not)
- 🧰 Toolbar Style
......
......@@ -128,6 +128,12 @@ QString ConfigValueProvider::cursorThemeName() const
return configGroup.readEntry(QStringLiteral("cursorTheme"), QStringLiteral("breeze_cursors"));
}
int ConfigValueProvider::cursorSize() const
{
KConfigGroup configGroup = inputConfig->group(QStringLiteral("Mouse"));
return configGroup.readEntry(QStringLiteral("cursorSize"), 24);
}
bool ConfigValueProvider::iconsOnButtons() const
{
KConfigGroup configGroup = kdeglobalsConfig->group(QStringLiteral("KDE"));
......
......@@ -33,6 +33,7 @@ public:
QString fontName() const;
QString iconThemeName() const;
QString cursorThemeName() const;
int cursorSize() const;
bool iconsOnButtons() const;
bool iconsInMenus() const;
int toolbarStyle() const;
......
......@@ -120,6 +120,15 @@ void GtkConfig::setCursorTheme() const
ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/CursorThemeName"), cursorThemeName);
}
void GtkConfig::setCursorSize() const
{
const int cursorSize = configValueProvider->cursorSize();
ConfigEditor::setGtk2ConfigValue(QStringLiteral("gtk-cursor-theme-size"), cursorSize);
ConfigEditor::setGtk3ConfigValueGSettings(QStringLiteral("cursor-size"), cursorSize);
ConfigEditor::setGtk3ConfigValueSettingsIni(QStringLiteral("gtk-cursor-theme-size"), cursorSize);
ConfigEditor::setGtk3ConfigValueXSettingsd(QStringLiteral("Gtk/CursorThemeSize"), cursorSize);
}
void GtkConfig::setIconsOnButtons() const
{
const bool iconsOnButtonsConfigValue = configValueProvider->iconsOnButtons();
......@@ -187,6 +196,7 @@ void GtkConfig::applyAllSettings() const
setFont();
setIconTheme();
setCursorTheme();
setCursorSize();
setIconsOnButtons();
setIconsInMenus();
setToolbarStyle();
......@@ -241,9 +251,13 @@ void GtkConfig::onKWinSettingsChange(const KConfigGroup &group, const QByteArray
void GtkConfig::onKCMInputSettingsChange(const KConfigGroup& group, const QByteArrayList& names) const
{
if (group.name() == QStringLiteral("Mouse")
&& names.contains("cursorTheme")) {
setCursorTheme();
if (group.name() == QStringLiteral("Mouse")) {
if (names.contains("cursorTheme")) {
setCursorTheme();
}
if (names.contains("cursorSize")) {
setCursorSize();
}
}
}
......
......@@ -40,6 +40,7 @@ public:
void setFont() const;
void setIconTheme() const;
void setCursorTheme() const;
void setCursorSize() const;
void setIconsOnButtons() const;
void setIconsInMenus() const;
void setToolbarStyle() const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment