From 866e8325e6e437ef9f84e9cb03640807cbeea47f Mon Sep 17 00:00:00 2001 From: Rafostar <40623528+Rafostar@users.noreply.github.com> Date: Mon, 2 Nov 2020 09:11:55 +0100 Subject: [PATCH] Do not show "Ends at" text when player is stopped --- clapper_src/revealers.js | 4 +++- clapper_src/widget.js | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/clapper_src/revealers.js b/clapper_src/revealers.js index 700a3c23..7fe62322 100644 --- a/clapper_src/revealers.js +++ b/clapper_src/revealers.js @@ -127,7 +127,9 @@ class ClapperRevealerTop extends CustomRevealer this.currentTime = new Gtk.Label(timeLabelOpts); this.currentTime.add_css_class('osdtime'); - this.endTime = new Gtk.Label(timeLabelOpts); + this.endTime = new Gtk.Label( + Object.assign(timeLabelOpts, { visible: false }) + ); this.endTime.add_css_class('osdendtime'); this.revealerGrid.attach(this.mediaTitle, 0, 0, 1, 1); diff --git a/clapper_src/widget.js b/clapper_src/widget.js index 723bf0a1..834fed88 100644 --- a/clapper_src/widget.js +++ b/clapper_src/widget.js @@ -310,6 +310,9 @@ var Widget = GObject.registerClass({ break; } + let isNotStopped = (state !== GstPlayer.PlayerState.STOPPED) + this.revealerTop.endTime.set_visible(isNotStopped); + if(state === GstPlayer.PlayerState.BUFFERING) return;