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

Anurag Chowdhury anurag at seeta.in
Thu Oct 7 14:26:41 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>
v1->v2 : reformated code style using pylint and pep-8 format 

diff --git a/src/sugar/graphics/animator.py b/src/sugar/graphics/animator.py
index 8fb298b..335c69e 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
-
+COUNTER = 1
 
 class Animator(gobject.GObject):
 
@@ -140,6 +140,10 @@ class Animation(object):
             # last frame
             frame = self.end
         else:
+            for COUNTER in range(0, 5):
+               easing = EASE_IN_EXPO
+               duration = duration*100
+               COUNTER = COUNTER + 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