Tweak overlay revealers show/hide logic

This commit is contained in:
Rafał Dzięgiel
2021-02-18 17:13:38 +01:00
parent 12591e106f
commit 834a690903
5 changed files with 125 additions and 134 deletions

View File

@@ -45,7 +45,11 @@ class ClapperCustomButton extends Gtk.Button
return;
const clapperWidget = this.get_ancestor(Gtk.Grid);
clapperWidget._setHideControlsTimeout();
clapperWidget.revealControls();
/* Button opens a popover */
if(this.popoverBox)
clapperWidget.isPopoverOpen = true;
}
});
@@ -124,8 +128,15 @@ class ClapperPopoverButtonBase extends CustomButton
_onClosed()
{
const { player } = this.get_ancestor(Gtk.Grid);
player.widget.grab_focus();
const clapperWidget = this.get_ancestor(Gtk.Grid);
clapperWidget.player.widget.grab_focus();
/* Set again timeout as popover is now closed */
if(clapperWidget.isFullscreenMode)
clapperWidget.revealControls();
clapperWidget.isPopoverOpen = false;
this.unset_state_flags(Gtk.StateFlags.CHECKED);
}