mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 07:42:23 +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);
|
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 */
|
* 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);
|
this._updateVolumeButtonIcon(volume);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -96,6 +96,9 @@ scale marks {
|
|||||||
.osd .volumescale trough highlight {
|
.osd .volumescale trough highlight {
|
||||||
min-width: 6px;
|
min-width: 6px;
|
||||||
}
|
}
|
||||||
|
.overamp trough highlight {
|
||||||
|
background: @error_color;
|
||||||
|
}
|
||||||
|
|
||||||
/* Floating Mode */
|
/* Floating Mode */
|
||||||
.floatingwindow {
|
.floatingwindow {
|
||||||
|
Reference in New Issue
Block a user