From 6971ddb9a44782cd525d6a0f416bdf3cdb82d346 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Fri, 12 Jan 2007 20:35:53 +0000 Subject: Support for activity icons inside the bundle. Patch by Gonzalo Odiard Modified by me to allow icon theme to override the bundle one. --- (limited to 'shell') diff --git a/shell/view/BuddyIcon.py b/shell/view/BuddyIcon.py index 38f8277..8e910ed 100644 --- a/shell/view/BuddyIcon.py +++ b/shell/view/BuddyIcon.py @@ -19,7 +19,7 @@ from view.BuddyMenu import BuddyMenu class BuddyIcon(MenuIcon): def __init__(self, shell, menu_shell, buddy): - MenuIcon.__init__(self, menu_shell, icon_name='stock-buddy', + MenuIcon.__init__(self, menu_shell, icon_name='theme:stock-buddy', color=buddy.get_color()) self._shell = shell diff --git a/shell/view/BuddyMenu.py b/shell/view/BuddyMenu.py index 82e58c2..2909fd9 100644 --- a/shell/view/BuddyMenu.py +++ b/shell/view/BuddyMenu.py @@ -82,10 +82,10 @@ class BuddyMenu(Menu): friends = shell_model.get_friends() if friends.has_buddy(self._buddy): - icon = CanvasIcon(icon_name='stock-remove') + icon = CanvasIcon(icon_name='theme:stock-remove') self.add_action(icon, BuddyMenu.ACTION_REMOVE_FRIEND) else: - icon = CanvasIcon(icon_name='stock-add') + icon = CanvasIcon(icon_name='theme:stock-add') self.add_action(icon, BuddyMenu.ACTION_MAKE_FRIEND) activity = shell_model.get_home().get_current_activity() @@ -94,7 +94,7 @@ class BuddyMenu(Menu): # FIXME check that the buddy is not in the activity already - icon = CanvasIcon(icon_name='stock-invite') + icon = CanvasIcon(icon_name='theme:stock-invite') self.add_action(icon, BuddyMenu.ACTION_INVITE) def __buddy_icon_changed_cb(self, buddy): diff --git a/shell/view/clipboardmenu.py b/shell/view/clipboardmenu.py index 178edef..5472e4b 100644 --- a/shell/view/clipboardmenu.py +++ b/shell/view/clipboardmenu.py @@ -53,7 +53,7 @@ class ClipboardMenu(Menu): if percent == 100 and activity: if not self._remove_icon: - self._remove_icon = CanvasIcon(icon_name='stock-remove') + self._remove_icon = CanvasIcon(icon_name='theme:stock-remove') self.add_action(self._remove_icon, ClipboardMenu.ACTION_DELETE) if not self._open_icon: @@ -77,7 +77,7 @@ class ClipboardMenu(Menu): self._stop_icon = None else: if not self._stop_icon: - self._stop_icon = CanvasIcon(icon_name='stock-close') + self._stop_icon = CanvasIcon(icon_name='theme:stock-close') self.add_action(self._stop_icon, ClipboardMenu.ACTION_STOP_DOWNLOAD) if self._remove_icon: diff --git a/shell/view/frame/ZoomBox.py b/shell/view/frame/ZoomBox.py index 484ee4e..ed10374 100644 --- a/shell/view/frame/ZoomBox.py +++ b/shell/view/frame/ZoomBox.py @@ -37,11 +37,11 @@ class ActivityMenu(Menu): self._add_close_action() def _add_mesh_action(self): - icon = CanvasIcon(icon_name='stock-share-mesh') + icon = CanvasIcon(icon_name='theme:stock-share-mesh') self.add_action(icon, ActivityMenu.ACTION_SHARE) def _add_close_action(self): - icon = CanvasIcon(icon_name='stock-close') + icon = CanvasIcon(icon_name='theme:stock-close') self.add_action(icon, ActivityMenu.ACTION_CLOSE) class ActivityIcon(MenuIcon): @@ -81,22 +81,22 @@ class ZoomBox(hippo.CanvasBox): self._menu_shell = menu_shell self._activity_icon = None - icon = CanvasIcon(icon_name='stock-zoom-mesh') + icon = CanvasIcon(icon_name='theme:stock-zoom-mesh') style.apply_stylesheet(icon, 'frame.ZoomIcon') icon.connect('activated', self._level_clicked_cb, sugar.ZOOM_MESH) self.append(icon) - icon = CanvasIcon(icon_name='stock-zoom-friends') + icon = CanvasIcon(icon_name='theme:stock-zoom-friends') style.apply_stylesheet(icon, 'frame.ZoomIcon') icon.connect('activated', self._level_clicked_cb, sugar.ZOOM_FRIENDS) self.append(icon) - icon = CanvasIcon(icon_name='stock-zoom-home') + icon = CanvasIcon(icon_name='theme:stock-zoom-home') style.apply_stylesheet(icon, 'frame.ZoomIcon') icon.connect('activated', self._level_clicked_cb, sugar.ZOOM_HOME) self.append(icon) - icon = CanvasIcon(icon_name='stock-zoom-activity') + icon = CanvasIcon(icon_name='theme:stock-zoom-activity') style.apply_stylesheet(icon, 'frame.ZoomIcon') icon.connect('activated', self._level_clicked_cb, sugar.ZOOM_ACTIVITY) self.append(icon) diff --git a/shell/view/frame/overlaybox.py b/shell/view/frame/overlaybox.py index 406173a..fed1139 100644 --- a/shell/view/frame/overlaybox.py +++ b/shell/view/frame/overlaybox.py @@ -9,7 +9,7 @@ class OverlayBox(hippo.CanvasBox): self._shell = shell - icon = CanvasIcon(icon_name='stock-chat') + icon = CanvasIcon(icon_name='theme:stock-chat') style.apply_stylesheet(icon, 'frame.OverlayIcon') icon.connect('activated', self._overlay_clicked_cb) self.append(icon) diff --git a/shell/view/home/MyIcon.py b/shell/view/home/MyIcon.py index 80e3a04..94d919c 100644 --- a/shell/view/home/MyIcon.py +++ b/shell/view/home/MyIcon.py @@ -19,5 +19,5 @@ from sugar import profile class MyIcon(CanvasIcon): def __init__(self): - CanvasIcon.__init__(self, icon_name='stock-buddy', + CanvasIcon.__init__(self, icon_name='theme:stock-buddy', color=profile.get_color()) -- cgit v0.9.1