From 864f3558705ed1ae4f67eab72b7fb2b41ee379b1 Mon Sep 17 00:00:00 2001 From: Benjamin Port Date: Tue, 7 Apr 2020 15:32:22 +0200 Subject: [PATCH] Set cursor size default to 24 to align with KCM Reviewers: #plasma, meven, davidedmundson Reviewed By: #plasma, davidedmundson Subscribers: kwin Tags: #kwin Maniphest Tasks: T12040 Differential Revision: https://phabricator.kde.org/D28654 --- cursor.cpp | 2 +- effects/startupfeedback/startupfeedback.cpp | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/cursor.cpp b/cursor.cpp index 47e7b1b812..d0fe596e3d 100644 --- a/cursor.cpp +++ b/cursor.cpp @@ -129,7 +129,7 @@ void Cursor::loadThemeFromKConfig() { KConfigGroup mousecfg(kwinApp()->inputConfig(), "Mouse"); const QString themeName = mousecfg.readEntry("cursorTheme", "default"); - const uint themeSize = mousecfg.readEntry("cursorSize", 0); + const uint themeSize = mousecfg.readEntry("cursorSize", 24); updateTheme(themeName, themeSize); } diff --git a/effects/startupfeedback/startupfeedback.cpp b/effects/startupfeedback/startupfeedback.cpp index 0b100bc4a2..5f1264ea15 100644 --- a/effects/startupfeedback/startupfeedback.cpp +++ b/effects/startupfeedback/startupfeedback.cpp @@ -80,7 +80,7 @@ StartupFeedbackEffect::StartupFeedbackEffect() , m_texture(nullptr) , m_type(BouncingFeedback) , m_blinkingShader(nullptr) - , m_cursorSize(0) + , m_cursorSize(24) , m_configWatcher(KConfigWatcher::create(KSharedConfig::openConfig("klaunchrc", KConfig::NoGlobals))) { for (int i = 0; i < 5; ++i) { @@ -278,13 +278,7 @@ void StartupFeedbackEffect::start(const QString& icon) auto readCursorSize = []() -> int { // read details about the mouse-cursor theme define per default KConfigGroup mousecfg(effects->inputConfig(), "Mouse"); - QString size = mousecfg.readEntry("cursorSize", QString()); - - // fetch a reasonable size for the cursor-theme image - bool ok; - int cursorSize = size.toInt(&ok); - if (!ok) - cursorSize = QApplication::style()->pixelMetric(QStyle::PM_LargeIconSize); + int cursorSize = mousecfg.readEntry("cursorSize", 24); return cursorSize; }; m_cursorSize = readCursorSize();