Reimplement the icon item to render svg directly.

Some regressions sorry, need also to fix pygoocanvas...
This commit is contained in:
Marco Pesenti Gritti
2006-08-31 22:29:31 +02:00
parent 110d1bf8ce
commit 0ae39c93e7
4 changed files with 132 additions and 32 deletions
+2 -2
View File
@@ -20,8 +20,8 @@ class PieceIcon(IconItem):
x = icon_radius * math.cos(icon_angle)
y = - icon_radius * math.sin(icon_angle)
icon_width = self.get_property('width')
icon_height = self.get_property('height')
icon_width = self.get_property('size')
icon_height = self.get_property('size')
self.set_property('x', x - icon_width / 2)
self.set_property('y', y - icon_height / 2)
+2 -2
View File
@@ -68,8 +68,8 @@ class HomeGroup(goocanvas.Group):
profile = sugar.conf.get_profile()
me = IconItem(icon_name = 'stock-buddy',
color = profile.get_color(), size = 150)
me.translate(600 - (me.get_property('width') / 2),
450 - (me.get_property('height') / 2))
me.translate(600 - (me.get_property('size') / 2),
450 - (me.get_property('size') / 2))
self.add_child(me)
def __theme_changed_cb(self, theme):
+2 -2
View File
@@ -20,8 +20,8 @@ class IconLayout:
self._icons.remove(icon)
def _is_valid_position(self, icon, x, y):
h_border = icon.props.width + 4
v_border = icon.props.height + 4
h_border = icon.props.size + 4
v_border = icon.props.size + 4
if x < self._x1 - h_border or x > self._x2 + h_border:
return True
if y < self._y1 - v_border or y > self._y2 + v_border: