From fbfb81c83bd96e968ba29a59eb799c666bff8ded Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Fri, 21 Nov 2025 22:18:56 +0100 Subject: [PATCH] action center: scrollable quick sliders (#2536) --- .../mainPage/MainPageBodySliders.qml | 2 ++ .../ii/modules/waffle/looks/WSlider.qml | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/dots/.config/quickshell/ii/modules/waffle/actionCenter/mainPage/MainPageBodySliders.qml b/dots/.config/quickshell/ii/modules/waffle/actionCenter/mainPage/MainPageBodySliders.qml index 506b828a0..e42f73537 100644 --- a/dots/.config/quickshell/ii/modules/waffle/actionCenter/mainPage/MainPageBodySliders.qml +++ b/dots/.config/quickshell/ii/modules/waffle/actionCenter/mainPage/MainPageBodySliders.qml @@ -33,6 +33,7 @@ ColumnLayout { WSlider { Layout.fillWidth: true value: root.brightnessMonitor?.brightness ?? 0 + scrollable: true onMoved: { root.brightnessMonitor?.setBrightness(value) } @@ -54,6 +55,7 @@ ColumnLayout { WSlider { Layout.fillWidth: true value: Audio.sink.audio.volume + scrollable: true onMoved: { Audio.sink.audio.volume = value; } diff --git a/dots/.config/quickshell/ii/modules/waffle/looks/WSlider.qml b/dots/.config/quickshell/ii/modules/waffle/looks/WSlider.qml index 8c3c51e03..0cb65c327 100644 --- a/dots/.config/quickshell/ii/modules/waffle/looks/WSlider.qml +++ b/dots/.config/quickshell/ii/modules/waffle/looks/WSlider.qml @@ -11,6 +11,8 @@ Slider { property real trackWidth: 4 property string tooltipContent: `${Math.round(value * 100)}` + property bool scrollable: false + stepSize: 0.02 leftPadding: 0 rightPadding: 0 @@ -22,10 +24,24 @@ Slider { } } - background: Item { + background: MouseArea { id: background anchors.fill: parent + onWheel: (event) => { + if (!root.scrollable) { + event.accepted = false; + return; + } + if (event.angleDelta.y > 0) { + root.value = Math.min(root.value + root.stepSize, 1) + root.moved() + } else { + root.value = Math.max(root.value - root.stepSize, 0) + root.moved() + } + } + Rectangle { id: trackHighlight anchors {