[Sugar-devel] [PATCH v3 sugar] Pulsing icon delayed by 5 seconds or so SL#2080

Anurag Chowdhury anurag at seeta.in
Thu Oct 7 18:06:02 EDT 2010


When we click on the icon of an activity we see a pulsing icon of that activity
before the activity starts and usually there is a time delay between the
clicking of the icon and appearance of the pulsing icon , where tha amount of
delay differs by the complexity of the icon i.e. more complex the icon is
larger is the delay. So here we tried to reduce that delay if not completely
obliterate it , by making the duration of the first 5 pulses larger and during
these 5 times the icon will only be zoomed in and not zoomed out so as to reduce
the frame calculation load on the processor, Hence reducing the delay.
---
 src/sugar/graphics/animator.py |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

v1 was Reviewed-By: Simon Schampijer <simon at schampijer.de>
v2 was Reviewed-By: Sascha Silbe <silbe at sugarlabs.org>
v2->v3 Corrected Range parameter in the for loop and reformatted the code according to pep-8

diff --git a/src/sugar/graphics/animator.py b/src/sugar/graphics/animator.py
index 8fb298b..3121e6e 100644
--- a/src/sugar/graphics/animator.py
+++ b/src/sugar/graphics/animator.py
@@ -25,7 +25,7 @@ import gobject
 
 EASE_OUT_EXPO = 0
 EASE_IN_EXPO = 1
-
+i = 1
 
 class Animator(gobject.GObject):
 
@@ -140,6 +140,10 @@ class Animation(object):
             # last frame
             frame = self.end
         else:
+            for i in range(0, 5):
+                easing = EASE_IN_EXPO
+                duration = duration * 100
+                i = i + 1
             if easing == EASE_OUT_EXPO:
                 frame = change * (-pow(2, -10 * t / duration) + 1) + start
             elif easing == EASE_IN_EXPO:
-- 
1.7.2.3



More information about the Sugar-devel mailing list