mirror of
https://github.com/Rafostar/clapper.git
synced 2025-08-30 16:02:00 +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.SLIDE_DOWN
|
||||||
: Gtk.RevealerTransitionType.CROSSFADE;
|
: Gtk.RevealerTransitionType.CROSSFADE;
|
||||||
|
|
||||||
/* Changing transition in middle can have dire consequences,
|
const isRevealed = this.child_revealed;
|
||||||
* so change only when not in transition */
|
|
||||||
if(this.reveal_child === 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;
|
this.transition_type = this._requestedTransition;
|
||||||
}
|
}
|
||||||
|
|
||||||
_onTopRevealed()
|
_onTopRevealed()
|
||||||
{
|
{
|
||||||
if(this.transition_type !== this._requestedTransition)
|
|
||||||
this.transition_type = this._requestedTransition;
|
|
||||||
|
|
||||||
if(this.child_revealed) {
|
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;
|
const clapperWidget = this.root.child;
|
||||||
if(!clapperWidget) return;
|
if(!clapperWidget) return;
|
||||||
|
|
||||||
|
@@ -333,9 +333,11 @@ class ClapperWidget extends Gtk.Grid
|
|||||||
|
|
||||||
updateTime()
|
updateTime()
|
||||||
{
|
{
|
||||||
|
const revealerTop = this.revealerTop;
|
||||||
|
|
||||||
if(
|
if(
|
||||||
!this.revealerTop.visible
|
!revealerTop.visible
|
||||||
|| !this.revealerTop.revealerGrid.visible
|
|| !revealerTop.revealerGrid.visible
|
||||||
)
|
)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user