mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 16:02:00 +02:00
Do not show tracks revealer when there are no tracks
This commit is contained in:
1
clapper_src/controls.js
vendored
1
clapper_src/controls.js
vendored
@@ -76,6 +76,7 @@ class ClapperControls extends Gtk.Box
|
|||||||
|
|
||||||
this.revealTracksRevealer = new Revealers.ButtonsRevealer('SLIDE_LEFT');
|
this.revealTracksRevealer = new Revealers.ButtonsRevealer('SLIDE_LEFT');
|
||||||
this.revealTracksRevealer.append(revealTracksButton);
|
this.revealTracksRevealer.append(revealTracksButton);
|
||||||
|
this.revealTracksRevealer.set_visible(false);
|
||||||
this.append(this.revealTracksRevealer);
|
this.append(this.revealTracksRevealer);
|
||||||
|
|
||||||
tracksRevealer.set_reveal_child(true);
|
tracksRevealer.set_reveal_child(true);
|
||||||
|
@@ -274,6 +274,8 @@ var Widget = GObject.registerClass({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let anyButtonShown = false;
|
||||||
|
|
||||||
for(let type of ['video', 'audio', 'subtitle']) {
|
for(let type of ['video', 'audio', 'subtitle']) {
|
||||||
let currStream = player[`get_current_${type}_track`]();
|
let currStream = player[`get_current_${type}_track`]();
|
||||||
let activeId = (currStream) ? currStream.get_index() : -1;
|
let activeId = (currStream) ? currStream.get_index() : -1;
|
||||||
@@ -299,8 +301,11 @@ var Widget = GObject.registerClass({
|
|||||||
);
|
);
|
||||||
debug(`showing popover button with contents: ${type}`);
|
debug(`showing popover button with contents: ${type}`);
|
||||||
this.controls[`${type}TracksButton`].set_visible(true);
|
this.controls[`${type}TracksButton`].set_visible(true);
|
||||||
|
|
||||||
|
anyButtonShown = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.controls.revealTracksRevealer.set_visible(anyButtonShown);
|
||||||
this.mediaInfoSignal = null;
|
this.mediaInfoSignal = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user