mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 07:42:23 +02:00
Add controls background on fullscreen
This commit is contained in:
3
clapper_src/controls.js
vendored
3
clapper_src/controls.js
vendored
@@ -31,7 +31,8 @@ var Controls = GObject.registerClass({
|
||||
this.positionScale = new Gtk.Scale({
|
||||
orientation: Gtk.Orientation.HORIZONTAL,
|
||||
value_pos: Gtk.PositionType.LEFT,
|
||||
draw_value: false
|
||||
draw_value: false,
|
||||
hexpand: true,
|
||||
});
|
||||
this.positionScale.connect(
|
||||
'button-press-event', this._onPositionScaleButtonPressEvent.bind(this)
|
||||
|
@@ -25,12 +25,15 @@ class ClapperInterface extends Gtk.Grid
|
||||
|
||||
this.overlay = new Gtk.Overlay();
|
||||
this.controls = new Controls();
|
||||
this.revealer= new Gtk.Revealer({
|
||||
this.revealer = new Gtk.Revealer({
|
||||
transition_duration: this.revealTime,
|
||||
transition_type: Gtk.RevealerTransitionType.SLIDE_UP,
|
||||
valign: Gtk.Align.END,
|
||||
});
|
||||
this.revealerBox = new Gtk.Box();
|
||||
this.revealerBox.get_style_context().add_class('background');
|
||||
|
||||
this.revealer.add(this.revealerBox);
|
||||
this.attach(this.overlay, 0, 0, 1, 1);
|
||||
this.attach(this.controls, 0, 1, 1, 1);
|
||||
}
|
||||
@@ -78,18 +81,15 @@ class ClapperInterface extends Gtk.Grid
|
||||
setControlsOnVideo(isOnVideo)
|
||||
{
|
||||
if(isOnVideo && !this.controlsInVideo) {
|
||||
this.remove_row(1);
|
||||
this.controls.margin = 8;
|
||||
this.controls.margin_start = 10;
|
||||
this.controls.margin_end = 10;
|
||||
this.remove(this.controls);
|
||||
this.overlay.add_overlay(this.revealer);
|
||||
this.revealer.add(this.controls);
|
||||
this.revealerBox.pack_start(this.controls, false, true, 0);
|
||||
this.revealer.show();
|
||||
this.revealerBox.show();
|
||||
}
|
||||
else if(!isOnVideo && this.controlsInVideo) {
|
||||
this.revealer.remove(this.controls);
|
||||
this.revealerBox.remove(this.controls);
|
||||
this.overlay.remove(this.revealer);
|
||||
this.controls.margin = 4;
|
||||
this.attach(this.controls, 0, 1, 1, 1);
|
||||
this.controls.show();
|
||||
}
|
||||
|
Reference in New Issue
Block a user