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 {