[gnome-shell/wip/fmuellner/ease-actors: 13/20] screenShield: Stop using custom transition



commit d3cd735cc5600c0b7df2cd8e60ac69af39b646ff
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Jul 26 02:38:49 2019 +0200

    screenShield: Stop using custom transition
    
    For animating the arrows on the screenshield, we currently use a custom
    transition function that tweens the opacity from 0 to maxOpacity in the
    first half of the animation, and from maxOpacity back to 0 in the second
    half.
    
    This doesn't easily translate to Clutter's own animation framework, so
    replace the custom transition with two consecutive tweens which do.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/22

 js/ui/screenShield.js | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/js/ui/screenShield.js b/js/ui/screenShield.js
index a7c5afdaf..552ca4c3d 100644
--- a/js/ui/screenShield.js
+++ b/js/ui/screenShield.js
@@ -5,7 +5,6 @@ const { AccountsService, Clutter, Cogl, Gio, GLib,
 const Cairo = imports.cairo;
 const Mainloop = imports.mainloop;
 const Signals = imports.signals;
-const TweenerEquations = imports.tweener.equations;
 
 const Background = imports.ui.background;
 const GnomeSession = imports.misc.gnomeSession;
@@ -736,14 +735,16 @@ var ScreenShield = class {
         for (let i = 0; i < arrows.length; i++) {
             arrows[i].opacity = 0;
             Tweener.addTween(arrows[i],
-                             { opacity: 0,
+                             { opacity: maxOpacity,
                                delay: (unitaryDelay * (N_ARROWS - (i + 1))) / 1000,
-                               time: ARROW_ANIMATION_TIME / 1000,
-                               transition(t, b, c, d) {
-                                   if (t < d / 2)
-                                       return TweenerEquations.easeOutQuad(t, 0, maxOpacity, d / 2);
-                                   else
-                                       return TweenerEquations.easeInQuad(t - d / 2, maxOpacity, 
-maxOpacity, d / 2);
+                               time: ARROW_ANIMATION_TIME / (2 * 1000),
+                               transition: 'easeOutQuad',
+                               onComplete: () => {
+                                   Tweener.addTween(arrors[i], {
+                                       opacity: 0,
+                                       time: ARROW_ANIMATION_TIME / (2 * 1000),
+                                       transition: 'easeInQuad'
+                                   });
                                }
                              });
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]