From 186c63bf0471f3b02ca6949f258b7e4f06113c6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Wed, 24 Feb 2021 12:04:26 +0100 Subject: [PATCH] Set unreveal timeout after reveal finishes Instead of setting hide controls timeout immediately when starting revealing, make the time controls are revealed constant by setting timeout after animation finishes. --- src/revealers.js | 9 +++++++++ src/widget.js | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/revealers.js b/src/revealers.js index 458219ba..d58c7641 100644 --- a/src/revealers.js +++ b/src/revealers.js @@ -31,6 +31,9 @@ class ClapperCustomRevealer extends Gtk.Revealer revealChild(isReveal) { + if(this.reveal_child === isReveal) + return; + if(isReveal) this.visible = true; @@ -188,6 +191,12 @@ class ClapperRevealerTop extends CustomRevealer { if(this.transition_type !== this._requestedTransition) this.transition_type = this._requestedTransition; + + if(this.child_revealed) { + const clapperWidget = this.root.child; + + clapperWidget._setHideControlsTimeout(); + } } }); diff --git a/src/widget.js b/src/widget.js index ee5d6fb9..c7223189 100644 --- a/src/widget.js +++ b/src/widget.js @@ -120,7 +120,10 @@ class ClapperWidget extends Gtk.Grid if(isAllowInput) this.setControlsCanFocus(true); - this._setHideControlsTimeout(); + /* Reset timeout if already revealed, otherwise + * timeout will be set after reveal finishes */ + if(this.revealerTop.child_revealed) + this._setHideControlsTimeout(); } toggleFullscreen()