From ef5447d2fa85770ba61348e8d3f22850afbf28a6 Mon Sep 17 00:00:00 2001 From: FUFSoB Date: Wed, 24 Sep 2025 14:11:44 +0500 Subject: [PATCH] bugfix: make volume consistent with `wpctl get-volume` --- Modules/Bar/Widgets/Microphone.qml | 2 +- Modules/Bar/Widgets/Volume.qml | 2 +- Modules/Settings/Tabs/AudioTab.qml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Modules/Bar/Widgets/Microphone.qml b/Modules/Bar/Widgets/Microphone.qml index 41e5dbff..26f06240 100644 --- a/Modules/Bar/Widgets/Microphone.qml +++ b/Modules/Bar/Widgets/Microphone.qml @@ -93,7 +93,7 @@ Item { icon: getIcon() compact: (Settings.data.bar.density === "compact") autoHide: false // Important to be false so we can hover as long as we want - text: Math.floor(AudioService.inputVolume * 100) + text: Math.round(AudioService.inputVolume * 100) suffix: "%" forceOpen: displayMode === "alwaysShow" forceClose: displayMode === "alwaysHide" diff --git a/Modules/Bar/Widgets/Volume.qml b/Modules/Bar/Widgets/Volume.qml index 03ac13c9..e1fa678a 100644 --- a/Modules/Bar/Widgets/Volume.qml +++ b/Modules/Bar/Widgets/Volume.qml @@ -79,7 +79,7 @@ Item { rightOpen: BarService.getPillDirection(root) icon: getIcon() autoHide: false // Important to be false so we can hover as long as we want - text: Math.floor(AudioService.volume * 100) + text: Math.round(AudioService.volume * 100) suffix: "%" forceOpen: displayMode === "alwaysShow" forceClose: displayMode === "alwaysHide" diff --git a/Modules/Settings/Tabs/AudioTab.qml b/Modules/Settings/Tabs/AudioTab.qml index d739b8ca..1036437f 100644 --- a/Modules/Settings/Tabs/AudioTab.qml +++ b/Modules/Settings/Tabs/AudioTab.qml @@ -54,7 +54,7 @@ ColumnLayout { to: Settings.data.audio.volumeOverdrive ? 1.5 : 1.0 value: localVolume stepSize: 0.01 - text: Math.floor(AudioService.volume * 100) + "%" + text: Math.round(AudioService.volume * 100) + "%" onMoved: { localVolume = value } @@ -94,7 +94,7 @@ ColumnLayout { to: Settings.data.audio.volumeOverdrive ? 1.5 : 1.0 value: AudioService.inputVolume stepSize: 0.01 - text: Math.floor(AudioService.inputVolume * 100) + "%" + text: Math.round(AudioService.inputVolume * 100) + "%" onMoved: value => AudioService.setInputVolume(value) } }