From e24193c5511ac236c1f3014debf797d07f56dae2 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Mon, 19 Feb 2007 17:59:29 +0100 Subject: [PATCH] Get rid of stylesheets for MyIcon. --- shell/view/home/FriendsBox.py | 5 ++--- shell/view/home/HomeBox.py | 4 +--- shell/view/home/MyIcon.py | 7 ++++--- shell/view/stylesheet.py | 8 -------- 4 files changed, 7 insertions(+), 17 deletions(-) diff --git a/shell/view/home/FriendsBox.py b/shell/view/home/FriendsBox.py index a0c467c6..c0178dd1 100644 --- a/shell/view/home/FriendsBox.py +++ b/shell/view/home/FriendsBox.py @@ -20,7 +20,7 @@ import hippo import gobject from sugar.graphics.spreadbox import SpreadBox -from sugar.graphics import style +from sugar.graphics import units from view.home.MyIcon import MyIcon from view.home.FriendView import FriendView @@ -33,8 +33,7 @@ class FriendsBox(SpreadBox, hippo.CanvasItem): self._menu_shell = menu_shell self._friends = {} - self._my_icon = MyIcon() - style.apply_stylesheet(self._my_icon, 'friends.MyIcon') + self._my_icon = MyIcon(units.LARGE_ICON_SCALE) self.append(self._my_icon, hippo.PACK_FIXED) friends = self._shell.get_model().get_friends() diff --git a/shell/view/home/HomeBox.py b/shell/view/home/HomeBox.py index 7fef59ac..bdc66210 100644 --- a/shell/view/home/HomeBox.py +++ b/shell/view/home/HomeBox.py @@ -19,7 +19,6 @@ import hippo from view.home.activitiesdonut import ActivitiesDonut from view.home.MyIcon import MyIcon from model.ShellModel import ShellModel -from sugar.graphics import style from sugar.graphics import units from sugar.graphics.iconcolor import IconColor @@ -34,8 +33,7 @@ class HomeBox(hippo.CanvasBox, hippo.CanvasItem): box_height=units.grid_to_pixels(7)) self.append(self._donut) - self._my_icon = MyIcon() - style.apply_stylesheet(self._my_icon, 'home.MyIcon') + self._my_icon = MyIcon(units.XLARGE_ICON_SCALE) self.append(self._my_icon, hippo.PACK_FIXED) shell.get_model().connect('notify::state', diff --git a/shell/view/home/MyIcon.py b/shell/view/home/MyIcon.py index 94d919c0..6fa36b60 100644 --- a/shell/view/home/MyIcon.py +++ b/shell/view/home/MyIcon.py @@ -18,6 +18,7 @@ from sugar.graphics.canvasicon import CanvasIcon from sugar import profile class MyIcon(CanvasIcon): - def __init__(self): - CanvasIcon.__init__(self, icon_name='theme:stock-buddy', - color=profile.get_color()) + def __init__(self, scale): + CanvasIcon.__init__(self, scale=scale, + icon_name='theme:stock-buddy', + color=profile.get_color()) diff --git a/shell/view/stylesheet.py b/shell/view/stylesheet.py index 92d5dfdf..6e983f32 100644 --- a/shell/view/stylesheet.py +++ b/shell/view/stylesheet.py @@ -35,18 +35,10 @@ frame_BuddyIcon = { 'scale' : style.standard_icon_scale } -home_MyIcon = { - 'scale' : style.xlarge_icon_scale -} - ring_ActivityIcon = { 'scale' : style.medium_icon_scale } -friends_MyIcon = { - 'scale' : style.large_icon_scale -} - friends_FriendIcon = { 'scale' : style.large_icon_scale }