mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-31 00:11:59 +02:00
Fix not updated volume icon on startup
This commit is contained in:
@@ -340,12 +340,6 @@ class ClapperInterface extends Gtk.Grid
|
|||||||
{
|
{
|
||||||
let volume = Number(volumeScale.get_value().toFixed(2));
|
let volume = Number(volumeScale.get_value().toFixed(2));
|
||||||
|
|
||||||
if(volume === this.lastVolumeValue)
|
|
||||||
return;
|
|
||||||
|
|
||||||
this.lastVolumeValue = volume;
|
|
||||||
this._player.set_volume(volume);
|
|
||||||
|
|
||||||
let icon = (volume <= 0)
|
let icon = (volume <= 0)
|
||||||
? 'muted'
|
? 'muted'
|
||||||
: (volume <= 0.33)
|
: (volume <= 0.33)
|
||||||
@@ -358,13 +352,19 @@ class ClapperInterface extends Gtk.Grid
|
|||||||
|
|
||||||
let iconName = `audio-volume-${icon}-symbolic`;
|
let iconName = `audio-volume-${icon}-symbolic`;
|
||||||
|
|
||||||
if(this.controls.volumeButton.image.icon_name === iconName)
|
if(this.controls.volumeButton.image.icon_name !== iconName)
|
||||||
return;
|
{
|
||||||
|
|
||||||
debug(`set volume icon: ${icon}`);
|
debug(`set volume icon: ${icon}`);
|
||||||
this.controls.volumeButton.image.set_from_icon_name(
|
this.controls.volumeButton.image.set_from_icon_name(
|
||||||
iconName,
|
iconName,
|
||||||
this.controls.volumeButton.image.icon_size
|
this.controls.volumeButton.image.icon_size
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(volume === this.lastVolumeValue)
|
||||||
|
return;
|
||||||
|
|
||||||
|
this.lastVolumeValue = volume;
|
||||||
|
this._player.set_volume(volume);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user