mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-29 23:32:04 +02:00
Change volume scale color when over-amplified
This commit is contained in:
14
clapper_src/controls.js
vendored
14
clapper_src/controls.js
vendored
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -96,6 +96,9 @@ scale marks {
|
||||
.osd .volumescale trough highlight {
|
||||
min-width: 6px;
|
||||
}
|
||||
.overamp trough highlight {
|
||||
background: @error_color;
|
||||
}
|
||||
|
||||
/* Floating Mode */
|
||||
.floatingwindow {
|
||||
|
Reference in New Issue
Block a user