diff --git a/Modules/Bar/Widgets/Volume.qml b/Modules/Bar/Widgets/Volume.qml index 753cfff9e..9dcbcc98d 100644 --- a/Modules/Bar/Widgets/Volume.qml +++ b/Modules/Bar/Widgets/Volume.qml @@ -73,6 +73,28 @@ Item { externalHideTimer.restart(); } } + + function onVolumeAtMaximum() { + if (!firstVolumeReceived) { + firstVolumeReceived = true; + } else { + // Hide any tooltip while the pill is visible / being updated + TooltipService.hide(); + pill.show(); + externalHideTimer.restart(); + } + } + + function onVolumeAtMinimum() { + if (!firstVolumeReceived) { + firstVolumeReceived = true; + } else { + // Hide any tooltip while the pill is visible / being updated + TooltipService.hide(); + pill.show(); + externalHideTimer.restart(); + } + } } Timer { diff --git a/Modules/OSD/OSD.qml b/Modules/OSD/OSD.qml index 348f412ee..fda71e3f2 100644 --- a/Modules/OSD/OSD.qml +++ b/Modules/OSD/OSD.qml @@ -251,6 +251,14 @@ Variants { showOSD(OSD.Type.Volume); } + function onVolumeAtMaximum() { + showOSD(OSD.Type.Volume); + } + + function onVolumeAtMinimum() { + showOSD(OSD.Type.Volume); + } + function onMutedChanged() { if (AudioService.consumeOutputOSDSuppression()) return; diff --git a/Services/Media/AudioService.qml b/Services/Media/AudioService.qml index e78efa481..4511dc695 100644 --- a/Services/Media/AudioService.qml +++ b/Services/Media/AudioService.qml @@ -29,6 +29,9 @@ Singleton { property real wpctlOutputVolume: 0 property bool wpctlOutputMuted: true + signal volumeAtMaximum() + signal volumeAtMinimum() + function clampOutputVolume(vol: real): real { if (vol === undefined || isNaN(vol)) { return 0; @@ -556,6 +559,7 @@ Singleton { return; } if (volume >= root.maxVolume) { + volumeAtMaximum(); return; } setVolume(Math.min(root.maxVolume, volume + stepVolume)); @@ -566,6 +570,7 @@ Singleton { return; } if (volume <= 0) { + volumeAtMinimum(); return; } setVolume(Math.max(0, volume - stepVolume));