Convert to the new icon format

This commit is contained in:
Marco Pesenti Gritti 2006-09-22 14:32:07 +02:00
parent 092ded9e53
commit d8c61d271a
6 changed files with 14 additions and 17 deletions

View File

@ -34,7 +34,7 @@ class InviteItem(IconItem):
class BottomPanel(CanvasBox):
def __init__(self, shell):
CanvasBox.__init__(self, shell.get_grid(), CanvasBox.HORIZONTAL, 1)
CanvasBox.__init__(self, shell.get_grid(), CanvasBox.HORIZONTAL)
self._shell = shell
self._invite_to_item = {}
@ -67,13 +67,13 @@ class BottomPanel(CanvasBox):
def add_activity(self, activity):
item = ActivityItem(activity)
item.connect('clicked', self.__activity_clicked_cb)
self.set_constraints(item, 3, 3)
self.set_constraints(item, 5, 5)
self.add_child(item)
def add_invite(self, invite):
item = InviteItem(invite)
item.connect('clicked', self.__invite_clicked_cb)
self.set_constraints(item, 3, 3)
self.set_constraints(item, 5, 5)
self.add_child(item, 0)
self._invite_to_item[invite] = item

View File

@ -10,7 +10,7 @@ from view.frame.MenuStrategy import MenuStrategy
class RightPanel(CanvasBox):
def __init__(self, shell, menu_shell):
CanvasBox.__init__(self, shell.get_grid(), CanvasBox.VERTICAL, 1)
CanvasBox.__init__(self, shell.get_grid(), CanvasBox.VERTICAL)
self._shell = shell
self._menu_shell = menu_shell
self._activity_ps = None
@ -27,7 +27,7 @@ class RightPanel(CanvasBox):
def add(self, buddy):
icon = BuddyIcon(self._shell, self._menu_shell, BuddyModel(buddy))
icon.set_menu_strategy(MenuStrategy())
self.set_constraints(icon, 3, 3)
self.set_constraints(icon, 5, 5)
self.add_child(icon)
self._buddies[buddy.get_name()] = icon

View File

@ -96,7 +96,7 @@ class TopPanel(goocanvas.Group):
if activity:
icon = ActivityIcon(self._shell, self._menu_shell, activity)
self._box.set_constraints(icon, 3, 3)
self._box.set_constraints(icon, 5, 5)
self._box.add_child(icon)
self._activity_icon = icon
else:

View File

@ -4,7 +4,7 @@ from sugar.canvas import Colors
def _parse_string(color_string):
if color_string == 'white':
return ['white', '#4f4f4f']
return ['#ffffff', '#4f4f4f']
splitted = color_string.split(',')
if len(splitted) == 2:

View File

@ -25,15 +25,12 @@ class _IconCache:
fill = color.get_fill_color()
stroke = color.get_stroke_color()
entity = '<!ENTITY fill_color "%s">' % fill
data = re.sub('<!ENTITY fill_color .*>', entity, data)
style = '.fill {fill:%s;stroke:%s;}' % (fill, fill)
data = re.sub('\.fill \{.*\}', style, data)
style = '.shape {stroke:%s;fill:%s;}' % (stroke, stroke)
data = re.sub('\.shape \{.*\}', style, data)
style = '.shape-and-fill {fill:%s; stroke:%s;}' % (fill, stroke)
data = re.sub('\.shape-and-fill \{.*\}', style, data)
entity = '<!ENTITY stroke_color "%s">' % stroke
data = re.sub('<!ENTITY stroke_color .*>', entity, data)
return rsvg.Handle(data=data)

View File

@ -45,7 +45,7 @@ class Menu(gtk.Window):
self._grid.set_constraints(separator, 0, 4)
self._root.add_child(separator)
box = CanvasBox(self._grid, CanvasBox.HORIZONTAL, 1)
box = CanvasBox(self._grid, CanvasBox.HORIZONTAL)
self._grid.set_constraints(box, 0, 5)
return box
@ -62,7 +62,7 @@ class Menu(gtk.Window):
self._update_constraints()
icon.connect('clicked', self._action_clicked_cb, action_id)
self._action_box.set_constraints(icon, 3, 3)
self._action_box.set_constraints(icon, 5, 5)
self._action_box.add_child(icon)
def _action_clicked_cb(self, icon, action):