OSD: fix 0% volume icon

This commit is contained in:
Ly-sec
2025-11-26 14:53:31 +01:00
parent 60eb9c6e78
commit a44137f81f
2 changed files with 6 additions and 5 deletions
+3 -2
View File
@@ -49,8 +49,9 @@ Variants {
case OSD.Type.Volume:
if (isMuted)
return "volume-mute";
if (currentVolume <= Number.EPSILON)
return "volume-zero";
// Show muted icon when volume is effectively 0% (within rounding threshold)
if (currentVolume < 0.005)
return "volume-mute";
return currentVolume <= 0.5 ? "volume-low" : "volume-high";
case OSD.Type.InputVolume:
return isInputMuted ? "microphone-off" : "microphone";
+3 -3
View File
@@ -205,10 +205,10 @@ Singleton {
const maxVolume = Settings.data.audio.volumeOverdrive ? 1.5 : 1.0;
const clampedVolume = Math.max(0, Math.min(volume, maxVolume));
const displayPercent = Math.round(clampedVolume * 100);
if (displayPercent === 0)
return "volume-zero";
// Show muted icon when volume is effectively 0% (within rounding threshold)
if (clampedVolume < 0.005)
return "volume-mute";
if (clampedVolume <= 0.5)
return "volume-low";
return "volume-high";