mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-31 16:31:58 +02:00
Hide time and position scale on LIVE media
This commit is contained in:
22
clapper_src/controls.js
vendored
22
clapper_src/controls.js
vendored
@@ -69,6 +69,18 @@ var Controls = GObject.registerClass({
|
||||
this.unfullscreenButton.set_visible(isFullscreen);
|
||||
}
|
||||
|
||||
setLiveMode(isLive, isSeekable)
|
||||
{
|
||||
/* This update must always happen
|
||||
* after media duration is set */
|
||||
let text = (isLive)
|
||||
? 'LIVE'
|
||||
: '00:00:00' + '/' + this.durationFormated;
|
||||
|
||||
this.elapsedButton.set_label(text);
|
||||
this.positionScale.visible = isSeekable;
|
||||
}
|
||||
|
||||
addButton(buttonIcon)
|
||||
{
|
||||
let button = (buttonIcon instanceof Gtk.Button)
|
||||
@@ -186,6 +198,7 @@ var Controls = GObject.registerClass({
|
||||
hexpand: true,
|
||||
valign: Gtk.Align.CENTER,
|
||||
can_focus: false,
|
||||
visible: false,
|
||||
});
|
||||
|
||||
this.togglePlayButton.bind_property('margin_top',
|
||||
@@ -206,7 +219,14 @@ var Controls = GObject.registerClass({
|
||||
);
|
||||
|
||||
this.positionAdjustment = this.positionScale.get_adjustment();
|
||||
this.append(this.positionScale);
|
||||
|
||||
let box = new Gtk.Box({
|
||||
orientation: Gtk.Orientation.HORIZONTAL,
|
||||
hexpand: true,
|
||||
can_focus: false,
|
||||
});
|
||||
box.append(this.positionScale);
|
||||
this.append(box);
|
||||
}
|
||||
|
||||
_addVolumeButton()
|
||||
|
Reference in New Issue
Block a user