Convert to the new icon format
This commit is contained in:
parent
092ded9e53
commit
d8c61d271a
@ -34,7 +34,7 @@ class InviteItem(IconItem):
|
|||||||
|
|
||||||
class BottomPanel(CanvasBox):
|
class BottomPanel(CanvasBox):
|
||||||
def __init__(self, shell):
|
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._shell = shell
|
||||||
self._invite_to_item = {}
|
self._invite_to_item = {}
|
||||||
@ -67,13 +67,13 @@ class BottomPanel(CanvasBox):
|
|||||||
def add_activity(self, activity):
|
def add_activity(self, activity):
|
||||||
item = ActivityItem(activity)
|
item = ActivityItem(activity)
|
||||||
item.connect('clicked', self.__activity_clicked_cb)
|
item.connect('clicked', self.__activity_clicked_cb)
|
||||||
self.set_constraints(item, 3, 3)
|
self.set_constraints(item, 5, 5)
|
||||||
self.add_child(item)
|
self.add_child(item)
|
||||||
|
|
||||||
def add_invite(self, invite):
|
def add_invite(self, invite):
|
||||||
item = InviteItem(invite)
|
item = InviteItem(invite)
|
||||||
item.connect('clicked', self.__invite_clicked_cb)
|
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.add_child(item, 0)
|
||||||
|
|
||||||
self._invite_to_item[invite] = item
|
self._invite_to_item[invite] = item
|
||||||
|
@ -10,7 +10,7 @@ from view.frame.MenuStrategy import MenuStrategy
|
|||||||
|
|
||||||
class RightPanel(CanvasBox):
|
class RightPanel(CanvasBox):
|
||||||
def __init__(self, shell, menu_shell):
|
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._shell = shell
|
||||||
self._menu_shell = menu_shell
|
self._menu_shell = menu_shell
|
||||||
self._activity_ps = None
|
self._activity_ps = None
|
||||||
@ -27,7 +27,7 @@ class RightPanel(CanvasBox):
|
|||||||
def add(self, buddy):
|
def add(self, buddy):
|
||||||
icon = BuddyIcon(self._shell, self._menu_shell, BuddyModel(buddy))
|
icon = BuddyIcon(self._shell, self._menu_shell, BuddyModel(buddy))
|
||||||
icon.set_menu_strategy(MenuStrategy())
|
icon.set_menu_strategy(MenuStrategy())
|
||||||
self.set_constraints(icon, 3, 3)
|
self.set_constraints(icon, 5, 5)
|
||||||
self.add_child(icon)
|
self.add_child(icon)
|
||||||
|
|
||||||
self._buddies[buddy.get_name()] = icon
|
self._buddies[buddy.get_name()] = icon
|
||||||
|
@ -96,7 +96,7 @@ class TopPanel(goocanvas.Group):
|
|||||||
|
|
||||||
if activity:
|
if activity:
|
||||||
icon = ActivityIcon(self._shell, self._menu_shell, 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._box.add_child(icon)
|
||||||
self._activity_icon = icon
|
self._activity_icon = icon
|
||||||
else:
|
else:
|
||||||
|
@ -4,7 +4,7 @@ from sugar.canvas import Colors
|
|||||||
|
|
||||||
def _parse_string(color_string):
|
def _parse_string(color_string):
|
||||||
if color_string == 'white':
|
if color_string == 'white':
|
||||||
return ['white', '#4f4f4f']
|
return ['#ffffff', '#4f4f4f']
|
||||||
|
|
||||||
splitted = color_string.split(',')
|
splitted = color_string.split(',')
|
||||||
if len(splitted) == 2:
|
if len(splitted) == 2:
|
||||||
|
@ -26,14 +26,11 @@ class _IconCache:
|
|||||||
fill = color.get_fill_color()
|
fill = color.get_fill_color()
|
||||||
stroke = color.get_stroke_color()
|
stroke = color.get_stroke_color()
|
||||||
|
|
||||||
style = '.fill {fill:%s;stroke:%s;}' % (fill, fill)
|
entity = '<!ENTITY fill_color "%s">' % fill
|
||||||
data = re.sub('\.fill \{.*\}', style, data)
|
data = re.sub('<!ENTITY fill_color .*>', entity, data)
|
||||||
|
|
||||||
style = '.shape {stroke:%s;fill:%s;}' % (stroke, stroke)
|
entity = '<!ENTITY stroke_color "%s">' % stroke
|
||||||
data = re.sub('\.shape \{.*\}', style, data)
|
data = re.sub('<!ENTITY stroke_color .*>', entity, data)
|
||||||
|
|
||||||
style = '.shape-and-fill {fill:%s; stroke:%s;}' % (fill, stroke)
|
|
||||||
data = re.sub('\.shape-and-fill \{.*\}', style, data)
|
|
||||||
|
|
||||||
return rsvg.Handle(data=data)
|
return rsvg.Handle(data=data)
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ class Menu(gtk.Window):
|
|||||||
self._grid.set_constraints(separator, 0, 4)
|
self._grid.set_constraints(separator, 0, 4)
|
||||||
self._root.add_child(separator)
|
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)
|
self._grid.set_constraints(box, 0, 5)
|
||||||
|
|
||||||
return box
|
return box
|
||||||
@ -62,7 +62,7 @@ class Menu(gtk.Window):
|
|||||||
self._update_constraints()
|
self._update_constraints()
|
||||||
|
|
||||||
icon.connect('clicked', self._action_clicked_cb, action_id)
|
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)
|
self._action_box.add_child(icon)
|
||||||
|
|
||||||
def _action_clicked_cb(self, icon, action):
|
def _action_clicked_cb(self, icon, action):
|
||||||
|
Loading…
Reference in New Issue
Block a user