Apply custom initial volume on realize

This commit is contained in:
Rafostar
2020-11-30 11:26:38 +01:00
parent 5206dc543d
commit 58afaa2c76
2 changed files with 6 additions and 5 deletions

View File

@@ -370,9 +370,11 @@ class ClapperControls extends Gtk.Box
scrollController.connect('scroll', player._onScroll.bind(player)); scrollController.connect('scroll', player._onScroll.bind(player));
this.volumeButton.add_controller(scrollController); this.volumeButton.add_controller(scrollController);
let lastVolume = settings.get_double('volume-last'); let initialVolume = (settings.get_string('volume-initial') === 'custom')
let cubicVolume = Misc.getCubicValue(lastVolume); ? settings.get_int('volume-value') / 100
this.volumeScale.set_value(cubicVolume); : Misc.getCubicValue(settings.get_double('volume-last'));
this.volumeScale.set_value(initialVolume);
} }
_onUnfullscreenClicked(button) _onUnfullscreenClicked(button)

View File

@@ -359,8 +359,7 @@ class ClapperPlayer extends PlayerBase
if(!this.doneStartup) { if(!this.doneStartup) {
this.doneStartup = true; this.doneStartup = true;
if(settings.get_string('volume-initial') === 'custom')
this.set_volume(settings.get_int('volume-value') / 100);
if(settings.get_boolean('fullscreen-auto')) { if(settings.get_boolean('fullscreen-auto')) {
let root = player.widget.get_root(); let root = player.widget.get_root();
let clapperWidget = root.get_child(); let clapperWidget = root.get_child();