From 7eea88774b7008a3c36bbba7465cd897aa5cb65a Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Tue, 5 Aug 2025 16:10:27 +1000 Subject: popouts/audio: scroll volume slider Also more spacing --- modules/bar/popouts/Audio.qml | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/modules/bar/popouts/Audio.qml b/modules/bar/popouts/Audio.qml index 84378c9..97f323e 100644 --- a/modules/bar/popouts/Audio.qml +++ b/modules/bar/popouts/Audio.qml @@ -55,7 +55,7 @@ Item { } StyledText { - Layout.topMargin: Appearance.spacing.small + Layout.topMargin: Appearance.spacing.normal Layout.bottomMargin: Appearance.spacing.small / 2 text: qsTr("Input") font.weight: 500 @@ -75,24 +75,37 @@ Item { } StyledText { - Layout.topMargin: Appearance.spacing.small + Layout.topMargin: Appearance.spacing.normal Layout.bottomMargin: Appearance.spacing.small / 2 - text: qsTr("Volume") + text: qsTr("Volume (%1)").arg(Audio.muted ? qsTr("Muted") : `${Math.round(Audio.volume * 100)}%`) font.weight: 500 } - StyledSlider { + CustomMouseArea { Layout.fillWidth: true implicitHeight: Appearance.padding.normal * 3 - value: Audio.volume - onMoved: Audio.setVolume(value) + onWheel: event => { + if (event.angleDelta.y > 0) + Audio.setVolume(Audio.volume + 0.1); + else if (event.angleDelta.y < 0) + Audio.setVolume(Audio.volume - 0.1); + } + + StyledSlider { + anchors.left: parent.left + anchors.right: parent.right + implicitHeight: parent.implicitHeight + + value: Audio.volume + onMoved: Audio.setVolume(value) - Behavior on value { - NumberAnimation { - duration: Appearance.anim.durations.normal - easing.type: Easing.BezierSpline - easing.bezierCurve: Appearance.anim.curves.standard + Behavior on value { + NumberAnimation { + duration: Appearance.anim.durations.normal + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.standard + } } } } -- cgit v1.2.3-freya