diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2007-09-08 10:10:35 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpg@redhat.com> | 2007-09-08 10:10:35 (GMT) |
commit | 34e9d30a9cd87e5b3fa665a0a4a9a954a5edb88e (patch) | |
tree | da168c2d98ab8b6e6458ef896564b684b94df71e /shell | |
parent | 434483f54a3a5477077a96167f17ee6e19e2a0e7 (diff) |
Improved icon caching logic
Diffstat (limited to 'shell')
-rw-r--r-- | shell/view/home/FriendsBox.py | 2 | ||||
-rw-r--r-- | shell/view/home/HomeBox.py | 2 | ||||
-rw-r--r-- | shell/view/home/MeshBox.py | 6 | ||||
-rw-r--r-- | shell/view/home/activitiesdonut.py | 6 |
4 files changed, 7 insertions, 9 deletions
diff --git a/shell/view/home/FriendsBox.py b/shell/view/home/FriendsBox.py index 2d83207..9a9ca9b 100644 --- a/shell/view/home/FriendsBox.py +++ b/shell/view/home/FriendsBox.py @@ -38,7 +38,7 @@ class FriendsBox(hippo.CanvasBox): self._layout = SpreadLayout() self.set_layout(self._layout) - self._owner_icon = CanvasIcon(icon_name='computer-xo', + self._owner_icon = CanvasIcon(icon_name='computer-xo', cache=True, xo_color=profile.get_color()) self._owner_icon.props.size = style.LARGE_ICON_SIZE palette = Palette(profile.get_nick_name()) diff --git a/shell/view/home/HomeBox.py b/shell/view/home/HomeBox.py index 9eb5716..8a65579 100644 --- a/shell/view/home/HomeBox.py +++ b/shell/view/home/HomeBox.py @@ -41,7 +41,7 @@ class HomeBox(hippo.CanvasBox, hippo.CanvasItem): def __init__(self, shell): hippo.CanvasBox.__init__(self, background_color=0xe2e2e2ff, yalign=2) - self._donut = ActivitiesDonut(shell,box_width=style.zoom(450), + self._donut = ActivitiesDonut(shell, box_width=style.zoom(450), box_height=style.zoom(450)) self.append(self._donut) diff --git a/shell/view/home/MeshBox.py b/shell/view/home/MeshBox.py index 4824cce..2209bde 100644 --- a/shell/view/home/MeshBox.py +++ b/shell/view/home/MeshBox.py @@ -43,7 +43,7 @@ _ICON_NAME = 'network-wireless' class AccessPointView(PulsingIcon): def __init__(self, model): - PulsingIcon.__init__(self, size=style.MEDIUM_ICON_SIZE) + PulsingIcon.__init__(self, size=style.MEDIUM_ICON_SIZE, cache=True) self._model = model self.connect('activated', self._activate_cb) @@ -124,7 +124,7 @@ _MESH_ICON_NAME = 'network-mesh' class MeshDeviceView(PulsingIcon): def __init__(self, nm_device): PulsingIcon.__init__(self, size=style.MEDIUM_ICON_SIZE, - icon_name=_MESH_ICON_NAME) + icon_name=_MESH_ICON_NAME, cache=True) self._nm_device = nm_device self.set_tooltip(_("Mesh Network")) @@ -180,7 +180,7 @@ class ActivityView(hippo.CanvasBox): self._layout = SnowflakeLayout() self.set_layout(self._layout) - self._icon = CanvasIcon(file_name=model.get_icon_name(), + self._icon = CanvasIcon(file_name=model.get_icon_name(), cache=True, xo_color=model.get_color(), box_width=80) self._icon.connect('activated', self._clicked_cb) self._icon.set_tooltip(self._model.activity.props.name) diff --git a/shell/view/home/activitiesdonut.py b/shell/view/home/activitiesdonut.py index de3f8bd..aa0adde 100644 --- a/shell/view/home/activitiesdonut.py +++ b/shell/view/home/activitiesdonut.py @@ -73,8 +73,8 @@ class ActivityIcon(CanvasIcon): self._level = self._level_max color = self._icon_colors[self._level] - CanvasIcon.__init__(self, file_name=icon_name, xo_color=color, - size=style.MEDIUM_ICON_SIZE) + CanvasIcon.__init__(self, file_name=icon_name, xo_color=color, + size=style.MEDIUM_ICON_SIZE, cache=True) self._activity = activity self._pulse_id = 0 @@ -159,7 +159,6 @@ class ActivityIcon(CanvasIcon): if self._pulse_id: return - self.props.cache_size = self._level_max self._pulse_id = gobject.timeout_add(self._INTERVAL, self._pulse_cb) def _stop_pulsing(self): @@ -168,7 +167,6 @@ class ActivityIcon(CanvasIcon): self._cleanup() self._level = 100.0 - self.props.cache_size = 1 self.props.xo_color = self._orig_color def _resume_activate_cb(self, menuitem): |