Add overlay for controls when fullscreen

When player is fullscreen playback controls are shown on top of video (at screen bottom). When windowed, controls are shown below the video instead.
This commit is contained in:
Rafostar
2020-09-03 20:01:26 +02:00
parent 2bef72fd95
commit 3d9bab0578
3 changed files with 72 additions and 6 deletions

View File

@@ -13,6 +13,7 @@ var Controls = GObject.registerClass({
super._init({
margin: 4,
spacing: 4,
valign: Gtk.Align.END,
});
this.togglePlayButton = this.addButton(
@@ -95,6 +96,16 @@ var Controls = GObject.registerClass({
widget.can_default = false;
}
setVolumeMarks(isAdded)
{
if(!isAdded)
return this.volumeScale.clear_marks();
this.volumeScale.add_mark(0, Gtk.PositionType.LEFT, '0%');
this.volumeScale.add_mark(1, Gtk.PositionType.LEFT, '100%');
this.volumeScale.add_mark(2, Gtk.PositionType.LEFT, '200%');
}
_prepareVolumeButton()
{
this.volumeAdjustment.set_upper(2.001);
@@ -114,9 +125,8 @@ var Controls = GObject.registerClass({
this.setDefaultWidgetBehaviour(child);
child.height_request = 200;
child.round_digits = 2;
child.add_mark(0, Gtk.PositionType.LEFT, '0%');
child.add_mark(1, Gtk.PositionType.LEFT, '100%');
child.add_mark(2, Gtk.PositionType.LEFT, '200%');
this.volumeScale = child;
this.setVolumeMarks(true);
}
}
}