[Sugar-devel] [PATCH sugar] jarabe.desktop.transitionbox: don't set icon size to float value

Sascha Silbe silbe at activitycentral.com
Sat Feb 26 13:41:33 EST 2011


Icon sizes are measured in pixels, so they should be integer values.

Signed-off-by: Sascha Silbe <silbe at activitycentral.com>
---

This bug might have caused the following kind of warning (see e.g.
SL#870 [1]):

/usr/lib/python2.6/site-packages/sugar/graphics/icon.py:136: DeprecationWarning: integer argument expected, got float
  info = theme.lookup_icon(self.icon_name, size, 0)

However, I cannot trigger the warning on any system (Debian Squeeze,
Fedora 14).

[1] https://bugs.sugarlabs.org/ticket/870

 src/jarabe/desktop/transitionbox.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/jarabe/desktop/transitionbox.py b/src/jarabe/desktop/transitionbox.py
index 4042044..fd2112c 100644
--- a/src/jarabe/desktop/transitionbox.py
+++ b/src/jarabe/desktop/transitionbox.py
@@ -34,7 +34,7 @@ class _Animation(animator.Animation):

     def next_frame(self, current):
         d = (self.end_size - self.start_size) * current
-        self._icon.props.size = self.start_size + d
+        self._icon.props.size = int(self.start_size + d)


 class _Layout(gobject.GObject, hippo.CanvasLayout):
--
1.7.2.3



More information about the Sugar-devel mailing list