From d8c61d271ad12225b2e08cf23a8b60feccb07bd1 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Fri, 22 Sep 2006 14:32:07 +0200 Subject: [PATCH] Convert to the new icon format --- shell/view/frame/BottomPanel.py | 6 +++--- shell/view/frame/RightPanel.py | 4 ++-- shell/view/frame/TopPanel.py | 2 +- sugar/canvas/IconColor.py | 2 +- sugar/canvas/IconItem.py | 13 +++++-------- sugar/canvas/Menu.py | 4 ++-- 6 files changed, 14 insertions(+), 17 deletions(-) diff --git a/shell/view/frame/BottomPanel.py b/shell/view/frame/BottomPanel.py index 5f98f016..7509576f 100644 --- a/shell/view/frame/BottomPanel.py +++ b/shell/view/frame/BottomPanel.py @@ -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 diff --git a/shell/view/frame/RightPanel.py b/shell/view/frame/RightPanel.py index d74d6ab4..04f94785 100644 --- a/shell/view/frame/RightPanel.py +++ b/shell/view/frame/RightPanel.py @@ -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 diff --git a/shell/view/frame/TopPanel.py b/shell/view/frame/TopPanel.py index e8dc5c45..5516bb52 100644 --- a/shell/view/frame/TopPanel.py +++ b/shell/view/frame/TopPanel.py @@ -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: diff --git a/sugar/canvas/IconColor.py b/sugar/canvas/IconColor.py index 84ca409e..77e67ef3 100644 --- a/sugar/canvas/IconColor.py +++ b/sugar/canvas/IconColor.py @@ -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: diff --git a/sugar/canvas/IconItem.py b/sugar/canvas/IconItem.py index c40fb449..69b3555f 100644 --- a/sugar/canvas/IconItem.py +++ b/sugar/canvas/IconItem.py @@ -25,15 +25,12 @@ class _IconCache: fill = color.get_fill_color() stroke = color.get_stroke_color() + + entity = '' % fill + data = re.sub('', 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 = '' % stroke + data = re.sub('', entity, data) return rsvg.Handle(data=data) diff --git a/sugar/canvas/Menu.py b/sugar/canvas/Menu.py index 4b53b553..2283f153 100644 --- a/sugar/canvas/Menu.py +++ b/sugar/canvas/Menu.py @@ -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):