summaryrefslogtreecommitdiff
path: root/modules/bar/popouts/Audio.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-08-05 16:10:27 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-08-05 16:10:27 +1000
commit7eea88774b7008a3c36bbba7465cd897aa5cb65a (patch)
treea4d011a56cf4fafd88892991b805585cb3e9a8e1 /modules/bar/popouts/Audio.qml
parentbar/popouts: add audio device switcher (#319) (diff)
downloadcaelestia-shell-7eea88774b7008a3c36bbba7465cd897aa5cb65a.tar.gz
caelestia-shell-7eea88774b7008a3c36bbba7465cd897aa5cb65a.tar.bz2
caelestia-shell-7eea88774b7008a3c36bbba7465cd897aa5cb65a.zip
popouts/audio: scroll volume slider
Also more spacing
Diffstat (limited to 'modules/bar/popouts/Audio.qml')
-rw-r--r--modules/bar/popouts/Audio.qml35
1 files 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
+ }
}
}
}