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
This commit is contained in:
Benjamin Port 2020-04-07 15:32:22 +02:00
parent a2fc6f8eda
commit 864f355870
2 changed files with 3 additions and 9 deletions

View file

@ -129,7 +129,7 @@ void Cursor::loadThemeFromKConfig()
{ {
KConfigGroup mousecfg(kwinApp()->inputConfig(), "Mouse"); KConfigGroup mousecfg(kwinApp()->inputConfig(), "Mouse");
const QString themeName = mousecfg.readEntry("cursorTheme", "default"); const QString themeName = mousecfg.readEntry("cursorTheme", "default");
const uint themeSize = mousecfg.readEntry("cursorSize", 0); const uint themeSize = mousecfg.readEntry("cursorSize", 24);
updateTheme(themeName, themeSize); updateTheme(themeName, themeSize);
} }

View file

@ -80,7 +80,7 @@ StartupFeedbackEffect::StartupFeedbackEffect()
, m_texture(nullptr) , m_texture(nullptr)
, m_type(BouncingFeedback) , m_type(BouncingFeedback)
, m_blinkingShader(nullptr) , m_blinkingShader(nullptr)
, m_cursorSize(0) , m_cursorSize(24)
, m_configWatcher(KConfigWatcher::create(KSharedConfig::openConfig("klaunchrc", KConfig::NoGlobals))) , m_configWatcher(KConfigWatcher::create(KSharedConfig::openConfig("klaunchrc", KConfig::NoGlobals)))
{ {
for (int i = 0; i < 5; ++i) { for (int i = 0; i < 5; ++i) {
@ -278,13 +278,7 @@ void StartupFeedbackEffect::start(const QString& icon)
auto readCursorSize = []() -> int { auto readCursorSize = []() -> int {
// read details about the mouse-cursor theme define per default // read details about the mouse-cursor theme define per default
KConfigGroup mousecfg(effects->inputConfig(), "Mouse"); KConfigGroup mousecfg(effects->inputConfig(), "Mouse");
QString size = mousecfg.readEntry("cursorSize", QString()); int cursorSize = mousecfg.readEntry("cursorSize", 24);
// 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);
return cursorSize; return cursorSize;
}; };
m_cursorSize = readCursorSize(); m_cursorSize = readCursorSize();