Change volume scale color when over-amplified

This commit is contained in:
Rafostar
2020-12-01 09:43:36 +01:00
parent f4da4dec71
commit def5bc5d96
2 changed files with 16 additions and 1 deletions

View File

@@ -436,8 +436,20 @@ class ClapperControls extends Gtk.Box
player.set_volume(linearVolume);
/* FIXME: Should be placed in 'volume-changed'
/* FIXME: All of below should be placed in 'volume-changed'
* event once we move to message bus API */
let cssClass = 'overamp';
let hasOveramp = (scale.has_css_class(cssClass));
if(volume > 1) {
if(!hasOveramp)
scale.add_css_class(cssClass);
}
else {
if(hasOveramp)
scale.remove_css_class(cssClass);
}
this._updateVolumeButtonIcon(volume);
}

View File

@@ -96,6 +96,9 @@ scale marks {
.osd .volumescale trough highlight {
min-width: 6px;
}
.overamp trough highlight {
background: @error_color;
}
/* Floating Mode */
.floatingwindow {