lightbox: Remove previously added tweens from target

Since commit 007d30573 we use an actor effect to apply the radial effect and
we pass the effect to the tweener in order to animate it.

However, we always still remove the previously added tween from the actor,
instead that from the actual target.

So, depending the radial effect state, remove the tweens from the proper target

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/653
This commit is contained in:
Marco Trevisan (Treviño) 2019-07-31 14:54:56 +02:00
parent 28ab1f4af4
commit 668128f8c9

View File

@ -154,9 +154,10 @@ var Lightbox = class Lightbox {
show(fadeInTime) { show(fadeInTime) {
fadeInTime = fadeInTime || 0; fadeInTime = fadeInTime || 0;
Tweener.removeTweens(this.actor);
if (this._radialEffect) { if (this._radialEffect) {
Tweener.addTween(this.actor.get_effect('radial'), let effect = this.actor.get_effect('radial');
Tweener.removeTweens(effect);
Tweener.addTween(effect,
{ brightness: VIGNETTE_BRIGHTNESS, { brightness: VIGNETTE_BRIGHTNESS,
vignetteSharpness: VIGNETTE_SHARPNESS, vignetteSharpness: VIGNETTE_SHARPNESS,
time: fadeInTime, time: fadeInTime,
@ -167,6 +168,7 @@ var Lightbox = class Lightbox {
} }
}); });
} else { } else {
Tweener.removeTweens(this.actor);
Tweener.addTween(this.actor, Tweener.addTween(this.actor,
{ opacity: 255 * this._fadeFactor, { opacity: 255 * this._fadeFactor,
time: fadeInTime, time: fadeInTime,
@ -185,9 +187,11 @@ var Lightbox = class Lightbox {
fadeOutTime = fadeOutTime || 0; fadeOutTime = fadeOutTime || 0;
this.shown = false; this.shown = false;
Tweener.removeTweens(this.actor);
if (this._radialEffect) { if (this._radialEffect) {
Tweener.addTween(this.actor.get_effect('radial'), let effect = this.actor.get_effect('radial');
Tweener.removeTweens(effect);
Tweener.addTween(effect,
{ brightness: 1.0, { brightness: 1.0,
vignetteSharpness: 0.0, vignetteSharpness: 0.0,
opacity: 0, opacity: 0,
@ -198,6 +202,7 @@ var Lightbox = class Lightbox {
} }
}); });
} else { } else {
Tweener.removeTweens(this.actor);
Tweener.addTween(this.actor, Tweener.addTween(this.actor,
{ opacity: 0, { opacity: 0,
time: fadeOutTime, time: fadeOutTime,