From 1194f3ffb8f415ea77d52193da8da7631b85b87c Mon Sep 17 00:00:00 2001 From: xxyangyoulin Date: Sat, 27 Dec 2025 03:43:47 +0800 Subject: [PATCH] media: add scroll wheel behavior configuration (#1160) --- quickshell/Common/SettingsData.qml | 1 + quickshell/Common/settings/SettingsSpec.js | 1 + quickshell/Modules/DankBar/Widgets/Media.qml | 5 ++++- quickshell/Modules/Settings/MediaPlayerTab.qml | 7 +++++++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/quickshell/Common/SettingsData.qml b/quickshell/Common/SettingsData.qml index 74c8fda5..5e287f51 100644 --- a/quickshell/Common/SettingsData.qml +++ b/quickshell/Common/SettingsData.qml @@ -177,6 +177,7 @@ Singleton { property bool waveProgressEnabled: true property bool scrollTitleEnabled: true property bool audioVisualizerEnabled: true + property bool audioScrollEnabled: true property bool clockCompactMode: false property bool focusedWindowCompactMode: false property bool runningAppsCompactMode: true diff --git a/quickshell/Common/settings/SettingsSpec.js b/quickshell/Common/settings/SettingsSpec.js index 2596bbd9..7ffa09ba 100644 --- a/quickshell/Common/settings/SettingsSpec.js +++ b/quickshell/Common/settings/SettingsSpec.js @@ -92,6 +92,7 @@ var SPEC = { waveProgressEnabled: { def: true }, scrollTitleEnabled: { def: true }, audioVisualizerEnabled: { def: true }, + audioScrollEnabled: { def: true }, clockCompactMode: { def: false }, focusedWindowCompactMode: { def: false }, runningAppsCompactMode: { def: true }, diff --git a/quickshell/Modules/DankBar/Widgets/Media.qml b/quickshell/Modules/DankBar/Widgets/Media.qml index 593f6673..29681445 100644 --- a/quickshell/Modules/DankBar/Widgets/Media.qml +++ b/quickshell/Modules/DankBar/Widgets/Media.qml @@ -52,9 +52,12 @@ BasePill { property real touchpadThreshold: 100 onWheel: function (wheelEvent) { - wheelEvent.accepted = true; if (!usePlayerVolume) return; + if (!SettingsData.audioScrollEnabled) + return; + + wheelEvent.accepted = true; const deltaY = wheelEvent.angleDelta.y; const isMouseWheelY = Math.abs(deltaY) >= 120 && (Math.abs(deltaY) % 120) === 0; diff --git a/quickshell/Modules/Settings/MediaPlayerTab.qml b/quickshell/Modules/Settings/MediaPlayerTab.qml index 376bc1e1..95f2f09c 100644 --- a/quickshell/Modules/Settings/MediaPlayerTab.qml +++ b/quickshell/Modules/Settings/MediaPlayerTab.qml @@ -43,6 +43,13 @@ Item { checked: SettingsData.audioVisualizerEnabled onToggled: checked => SettingsData.set("audioVisualizerEnabled", checked) } + + SettingsToggleRow { + text: I18n.tr("Scroll Wheel") + description: I18n.tr("Scroll on widget changes media volume") + checked: SettingsData.audioScrollEnabled + onToggled: checked => SettingsData.set("audioScrollEnabled", checked) + } } } }