From ebe72f20b55ebfdbc5d71720c25b22e9a35627ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Fri, 9 Apr 2021 17:54:48 +0200 Subject: [PATCH] Hide end time together with title when stopped --- src/revealers.js | 3 +++ src/widget.js | 4 +--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/revealers.js b/src/revealers.js index 8e99de7e..1746be39 100644 --- a/src/revealers.js +++ b/src/revealers.js @@ -128,6 +128,9 @@ class ClapperRevealerTop extends CustomRevealer this.set_child(revealerBox); + this.mediaTitle.bind_property('visible', this.endTime, 'visible', + GObject.BindingFlags.DEFAULT + ); this.connect('notify::child-revealed', this._onTopRevealed.bind(this)); } diff --git a/src/widget.js b/src/widget.js index 3140d712..0d1672bc 100644 --- a/src/widget.js +++ b/src/widget.js @@ -449,6 +449,7 @@ class ClapperWidget extends Gtk.Grid debug('player state changed to: STOPPED'); this.controls.currentPosition = 0; this.controls.positionScale.set_value(0); + this.revealerTop.showTitle = false; this.controls.togglePlayButton.setPrimaryIcon(); break; case GstClapper.ClapperState.PAUSED: @@ -462,9 +463,6 @@ class ClapperWidget extends Gtk.Grid default: break; } - - const isNotStopped = (state !== GstClapper.ClapperState.STOPPED); - this.revealerTop.endTime.visible = isNotStopped; } _onPlayerDurationChanged(player, duration)