VolumeStatus: change the definition of high/medium/low

Do it the same way as gnome-settings-daemon, so that OSD does not
look "out-of-sync" with the status icon.

https://bugzilla.gnome.org/show_bug.cgi?id=641538
This commit is contained in:
Giovanni Campagna 2011-02-05 19:42:50 +01:00
parent fd8572d44a
commit ad27b9eda5

View File

@ -164,10 +164,10 @@ Indicator.prototype = {
if (volume <= 0) { if (volume <= 0) {
return 'audio-volume-muted'; return 'audio-volume-muted';
} else { } else {
let v = volume / VOLUME_MAX; let n = Math.floor(3 * volume / VOLUME_MAX) + 1;
if (v < 0.33) if (n < 2)
return 'audio-volume-low'; return 'audio-volume-low';
if (v > 0.8) if (n >= 3)
return 'audio-volume-high'; return 'audio-volume-high';
return 'audio-volume-medium'; return 'audio-volume-medium';
} }