[gnome-shell/T27795: 68/138] Don't animate the icons when entering/leaving the icon grid



commit 07d57badb456a59d8bd0794201f57483bc88a130
Author: Mario Sanchez Prada <mario endlessm com>
Date:   Thu Jun 15 15:34:18 2017 +0100

    Don't animate the icons when entering/leaving the icon grid

 js/ui/appDisplay.js |   7 +++-
 js/ui/iconGrid.js   | 106 +---------------------------------------------------
 2 files changed, 7 insertions(+), 106 deletions(-)
---
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index 88ec73ae27..13398236c5 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -237,8 +237,11 @@ class BaseAppView {
 
     _doSpringAnimation(animationDirection) {
         this._grid.opacity = 255;
-        this._grid.animateSpring(animationDirection,
-                                 Main.overview.getShowAppsButton());
+
+        // We don't do the icon grid animations on Endless, but we still need
+        // to call this method so that the animation-done signal gets emitted,
+        // in order not to break the transitoins.
+        this._grid.animateSpring(animationDirection, null);
     }
 
     animate(animationDirection, onComplete) {
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index ffddd11bdf..ecc7b559d5 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -506,110 +506,8 @@ var IconGrid = GObject.registerClass({
     }
 
     animateSpring(animationDirection, sourceActor) {
-        this._resetAnimationActors();
-
-        let actors = this._getChildrenToAnimate();
-        if (actors.length == 0) {
-            this._animationDone();
-            return;
-        }
-
-        let [sourceX, sourceY] = sourceActor.get_transformed_position();
-        let [sourceWidth, sourceHeight] = sourceActor.get_size();
-        // Get the center
-        let [sourceCenterX, sourceCenterY] = [sourceX + sourceWidth / 2, sourceY + sourceHeight / 2];
-        // Design decision, 1/2 of the source actor size.
-        let [sourceScaledWidth, sourceScaledHeight] = [sourceWidth / 2, sourceHeight / 2];
-
-        actors.forEach(actor => {
-            let [actorX, actorY] = actor._transformedPosition = actor.get_transformed_position();
-            let [x, y] = [actorX - sourceX, actorY - sourceY];
-            actor._distance = Math.sqrt(x * x + y * y);
-        });
-        let maxDist = actors.reduce((prev, cur) => {
-            return Math.max(prev, cur._distance);
-        }, 0);
-        let minDist = actors.reduce((prev, cur) => {
-            return Math.min(prev, cur._distance);
-        }, Infinity);
-        let normalization = maxDist - minDist;
-
-        for (let index = 0; index < actors.length; index++) {
-            let actor = actors[index];
-            actor.opacity = 0;
-            actor.reactive = false;
-
-            let actorClone = new Clutter.Clone({ source: actor });
-            this._clonesAnimating.push(actorClone);
-            Main.uiGroup.add_actor(actorClone);
-
-            let [width, height] = this._getAllocatedChildSizeAndSpacing(actor);
-            actorClone.set_size(width, height);
-            let scaleX = sourceScaledWidth / width;
-            let scaleY = sourceScaledHeight / height;
-            let [adjustedSourcePositionX, adjustedSourcePositionY] = [sourceCenterX - sourceScaledWidth / 2, 
sourceCenterY - sourceScaledHeight / 2];
-
-            let movementParams, fadeParams;
-            if (animationDirection == AnimationDirection.IN) {
-                let isLastItem = actor._distance == minDist;
-
-                actorClone.opacity = 0;
-                actorClone.set_scale(scaleX, scaleY);
-
-                actorClone.set_position(adjustedSourcePositionX, adjustedSourcePositionY);
-
-                let delay = (1 - (actor._distance - minDist) / normalization) * ANIMATION_MAX_DELAY_FOR_ITEM;
-                let [finalX, finalY]  = actor._transformedPosition;
-                movementParams = {
-                    x: finalX,
-                    y: finalY,
-                    scale_x: 1,
-                    scale_y: 1,
-                    duration: ANIMATION_TIME_IN,
-                    mode: Clutter.AnimationMode.EASE_IN_OUT_QUAD,
-                    delay
-                };
-
-                if (isLastItem)
-                    movementParams.onComplete = this._animationDone.bind(this);
-
-                fadeParams = {
-                    opacity: 255,
-                    duration: ANIMATION_FADE_IN_TIME_FOR_ITEM,
-                    mode: Clutter.AnimationMode.EASE_IN_OUT_QUAD,
-                    delay
-                };
-            } else {
-                let isLastItem = actor._distance == maxDist;
-
-                let [startX, startY]  = actor._transformedPosition;
-                actorClone.set_position(startX, startY);
-
-                let delay = (actor._distance - minDist) / normalization * ANIMATION_MAX_DELAY_OUT_FOR_ITEM;
-                movementParams = {
-                    x: adjustedSourcePositionX,
-                    y: adjustedSourcePositionY,
-                    scale_x: scaleX,
-                    scale_y: scaleY,
-                    duration: ANIMATION_TIME_OUT,
-                    mode: Clutter.AnimationMode.EASE_IN_OUT_QUAD,
-                    delay
-                };
-
-                if (isLastItem)
-                    movementParams.onComplete = this._animationDone.bind(this);
-
-                fadeParams = {
-                    opacity: 0,
-                    duration: ANIMATION_FADE_IN_TIME_FOR_ITEM,
-                    mode: Clutter.AnimationMode.EASE_IN_OUT_QUAD,
-                    delay: ANIMATION_TIME_OUT + delay - ANIMATION_FADE_IN_TIME_FOR_ITEM
-                };
-            }
-
-            actorClone.ease(movementParams);
-            actorClone.ease(fadeParams);
-        }
+        // We don't do the icon grid animations on Endless
+        this._animationDone();
     }
 
     _getAllocatedChildSizeAndSpacing(child) {


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