[Sugar-devel] [PATCH sugar] Do startup animation of the activity icon using scaling and alpha - v3

Gonzalo Odiard godiard at sugarlabs.org
Sun Aug 14 21:09:01 EDT 2011


I think, I found the problem. Attached is a new patch (it's like the last
one, but with this change).
The difference between this patch and the previous is reset the phase when
stop the pulsing,
and use cos() instead of sin() because cos(1) = 1
Regards

Gonzalo

[gonzalo at aronax sugar]$ git diff
diff --git a/src/jarabe/view/pulsingicon.py b/src/jarabe/view/pulsingicon.py
index 2c106b0..c68a712 100644
--- a/src/jarabe/view/pulsingicon.py
+++ b/src/jarabe/view/pulsingicon.py
@@ -60,12 +60,13 @@ class Pulser(object):
             gobject.source_remove(self._pulse_hid)
             self._pulse_hid = None
         self._icon.xo_color = self._icon.get_base_color()
+        self._phase = 0
         self._icon.alpha = 1.0

     def update(self):
         self._icon.xo_color = self._icon.base_color
         self._icon.alpha = _MINIMAL_ALPHA_VALUE + \
-                (1 - _MINIMAL_ALPHA_VALUE) * (math.sin(self._phase) + 1) /
2
+                (1 - _MINIMAL_ALPHA_VALUE) * (math.cos(self._phase) + 1) /
2

     def __pulse_cb(self):
         self._phase += _STEP





On Sat, Aug 13, 2011 at 9:40 AM, Simon Schampijer <simon at schampijer.de>wrote:

> On 08/12/2011 08:41 PM, godiard at sugarlabs.org wrote:
>
>> From: Gonzalo Odiard<godiard at sugarlabs.org>
>>
>> This render the SVG image only one time, and then use alpha and scaling
>> of the rendered icon and will speed up the overall activity startup.
>> Another side effect is that the startup zoom not visible in many
>> activities, is visible now - #2080
>>
>>     Signed-off-by: Gonzalo Odiard<gonzalo at laptop.org>
>>     Acked-By: Simon Schampijer<simon at laptop.org>
>>
>
> Hi Gonzalo, thanks for the patches. The color seem to not be fully set for
> the Access Point pulsingicon in the Frame (screenshot attached). Would be
> great if you could have a look at that.
>
> Regards,
>   Simon
>



-- 
Gonzalo Odiard
SugarLabs Argentina
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20110814/7d037e91/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Do-startup-animation-of-the-activity-icon-using-scal.patch
Type: text/x-diff
Size: 10028 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20110814/7d037e91/attachment-0001.patch>


More information about the Sugar-devel mailing list