mirror of
https://github.com/Rafostar/clapper.git
synced 2025-09-01 08:51:59 +02:00
Move fullscreen and menu buttons to header bar
Follow other GNOME apps designs by having fullscreen button on the right side of window header bar. The control panel had too many buttons already and we still need to make some space for playlist. This way "fullscreen" button will be on top bar while windowed and "unfullscreen" button will appear on the bottom right only when player entered fullscreen mode.
This commit is contained in:
@@ -93,15 +93,20 @@ class ClapperInterface extends Gtk.Grid
|
||||
|
||||
setControlsOnVideo(isOnVideo)
|
||||
{
|
||||
if(isOnVideo && !this.controlsInVideo) {
|
||||
if(this.controlsInVideo === isOnVideo)
|
||||
return;
|
||||
|
||||
if(isOnVideo) {
|
||||
this.remove(this.controls);
|
||||
this.controls.pack_start(this.controls.unfullscreenButton, false, false, 0);
|
||||
this.overlay.add_overlay(this.revealer);
|
||||
this.revealerBox.pack_start(this.controls, false, true, 0);
|
||||
this.revealer.show();
|
||||
this.revealerBox.show();
|
||||
}
|
||||
else if(!isOnVideo && this.controlsInVideo) {
|
||||
else {
|
||||
this.revealerBox.remove(this.controls);
|
||||
this.controls.remove(this.controls.unfullscreenButton);
|
||||
this.overlay.remove(this.revealer);
|
||||
this.attach(this.controls, 0, 1, 1, 1);
|
||||
this.controls.show();
|
||||
@@ -260,10 +265,10 @@ class ClapperInterface extends Gtk.Grid
|
||||
case GstPlayer.PlayerState.STOPPED:
|
||||
this.needsTracksUpdate = true;
|
||||
case GstPlayer.PlayerState.PAUSED:
|
||||
this.controls.togglePlayButton.image = this.controls.playImage;
|
||||
this.controls.togglePlayButton.setPlayImage();
|
||||
break;
|
||||
case GstPlayer.PlayerState.PLAYING:
|
||||
this.controls.togglePlayButton.image = this.controls.pauseImage;
|
||||
this.controls.togglePlayButton.setPauseImage();
|
||||
if(this.needsTracksUpdate) {
|
||||
this.needsTracksUpdate = false;
|
||||
this.updateMediaTracks();
|
||||
|
Reference in New Issue
Block a user