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.
This commit is contained in:
Rafał Dzięgiel
2021-02-24 12:04:26 +01:00
parent 68bd65c225
commit 186c63bf04
2 changed files with 13 additions and 1 deletions

View File

@@ -31,6 +31,9 @@ class ClapperCustomRevealer extends Gtk.Revealer
revealChild(isReveal) revealChild(isReveal)
{ {
if(this.reveal_child === isReveal)
return;
if(isReveal) if(isReveal)
this.visible = true; this.visible = true;
@@ -188,6 +191,12 @@ class ClapperRevealerTop extends CustomRevealer
{ {
if(this.transition_type !== this._requestedTransition) if(this.transition_type !== this._requestedTransition)
this.transition_type = this._requestedTransition; this.transition_type = this._requestedTransition;
if(this.child_revealed) {
const clapperWidget = this.root.child;
clapperWidget._setHideControlsTimeout();
}
} }
}); });

View File

@@ -120,7 +120,10 @@ class ClapperWidget extends Gtk.Grid
if(isAllowInput) if(isAllowInput)
this.setControlsCanFocus(true); 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() toggleFullscreen()