[gnome-shell] iconGrid: Don't use clones for pulse animation



commit 63efe1db11ce6ef8824ed8e8fd2125aa59424f65
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Sep 18 13:29:35 2014 +0100

    iconGrid: Don't use clones for pulse animation
    
    The spring animation has to use clones to escape any clip set on the
    parent, as it mainly occurs outside the parent. The same does not apply
    to the pulse animation, which is very much in place - in fact, if the
    parent is clipped (for instance a scrolled app folder), not having the
    clip applied to the animated icons is indeed wrong.
    Just animate the original grid actors instead, which gives the expected
    result.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=736885

 js/ui/iconGrid.js |   21 ++++-----------------
 1 files changed, 4 insertions(+), 17 deletions(-)
---
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index 9432bdf..a35489b 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -431,31 +431,21 @@ const IconGrid = new Lang.Class({
 
         for (let index = 0; index < actors.length; index++) {
             let actor = actors[index];
-            actor.opacity = 0;
             actor.reactive = false;
+            actor.set_scale(0, 0);
+            actor.set_pivot_point(0.5, 0.5);
 
             let delay = index / actors.length * ANIMATION_MAX_DELAY_FOR_ITEM;
-            let [originalX, originalY] = actor.get_transformed_position();
-            let [originalWidth, originalHeight,,] = this._getAllocatedChildSizeAndSpacing(actor);
-
-            let actorClone = new Clutter.Clone({ source: actor });
-            Main.uiGroup.add_actor(actorClone);
-
-            actorClone.set_position(originalX, originalY);
-            actorClone.set_scale(0, 0);
-            actorClone.set_pivot_point(0.5, 0.5);
-            actorClone.set_size(originalWidth, originalHeight);
-
             let bounceUpTime = ANIMATION_TIME_IN / 4;
             let isLastItem = index == actors.length - 1;
-            Tweener.addTween(actorClone,
+            Tweener.addTween(actor,
                             { time: bounceUpTime,
                               transition: 'easeInOutQuad',
                               delay: delay,
                               scale_x: ANIMATION_BOUNCE_ICON_SCALE,
                               scale_y: ANIMATION_BOUNCE_ICON_SCALE,
                               onComplete: Lang.bind(this, function() {
-                                  Tweener.addTween(actorClone,
+                                  Tweener.addTween(actor,
                                                    { time: ANIMATION_TIME_IN - bounceUpTime,
                                                      transition: 'easeInOutQuad',
                                                      scale_x: 1,
@@ -463,10 +453,7 @@ const IconGrid = new Lang.Class({
                                                      onComplete: Lang.bind(this, function() {
                                                         if (isLastItem)
                                                             this._animationDone();
-
-                                                        actor.opacity = 255;
                                                         actor.reactive = true;
-                                                        actorClone.destroy();
                                                     })
                                                    });
                               })


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