mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-06-02 02:26:00 +00:00
OSD: fix 0% volume icon
This commit is contained in:
+3
-2
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user