mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 07:42:23 +02:00
Workaround GTK4 revealers transition switch bug
Changing transition in middle or when not fully revealed has dire consequences, seems to be a GTK4 bug. Workaround this bug by switching top revealer transition type only when fully revealed.
This commit is contained in:
@@ -181,18 +181,27 @@ class ClapperRevealerTop extends CustomRevealer
|
||||
? Gtk.RevealerTransitionType.SLIDE_DOWN
|
||||
: Gtk.RevealerTransitionType.CROSSFADE;
|
||||
|
||||
/* Changing transition in middle can have dire consequences,
|
||||
* so change only when not in transition */
|
||||
if(this.reveal_child === this.child_revealed)
|
||||
const isRevealed = this.child_revealed;
|
||||
|
||||
/* FIXME: Changing transition in middle or when not fully
|
||||
* revealed has dire consequences, seems to be a GTK4 bug */
|
||||
if(isRevealed && isRevealed === this.reveal_child)
|
||||
this._checkSwitchTransitionType();
|
||||
}
|
||||
|
||||
_checkSwitchTransitionType()
|
||||
{
|
||||
if(this.transition_type !== this._requestedTransition)
|
||||
this.transition_type = this._requestedTransition;
|
||||
}
|
||||
|
||||
_onTopRevealed()
|
||||
{
|
||||
if(this.transition_type !== this._requestedTransition)
|
||||
this.transition_type = this._requestedTransition;
|
||||
|
||||
if(this.child_revealed) {
|
||||
/* TODO: Move before above if statement when GTK4 can handle
|
||||
* changing transition type while not fully revealed */
|
||||
this._checkSwitchTransitionType();
|
||||
|
||||
const clapperWidget = this.root.child;
|
||||
if(!clapperWidget) return;
|
||||
|
||||
|
@@ -333,9 +333,11 @@ class ClapperWidget extends Gtk.Grid
|
||||
|
||||
updateTime()
|
||||
{
|
||||
const revealerTop = this.revealerTop;
|
||||
|
||||
if(
|
||||
!this.revealerTop.visible
|
||||
|| !this.revealerTop.revealerGrid.visible
|
||||
!revealerTop.visible
|
||||
|| !revealerTop.revealerGrid.visible
|
||||
)
|
||||
return null;
|
||||
|
||||
|
Reference in New Issue
Block a user