Basic implementation of the shutdown graphics

This commit is contained in:
Marco Pesenti Gritti
2007-01-11 11:20:08 +01:00
parent dda16d83c0
commit 297381cad7
7 changed files with 57 additions and 3 deletions
+13
View File
@@ -18,8 +18,10 @@ import hippo
from view.home.activitiesdonut import ActivitiesDonut
from view.home.MyIcon import MyIcon
from model.ShellModel import ShellModel
from sugar.graphics.grid import Grid
from sugar.graphics import style
from sugar.graphics.iconcolor import IconColor
class HomeBox(hippo.CanvasBox, hippo.CanvasItem):
__gtype_name__ = 'SugarHomeBox'
@@ -36,6 +38,17 @@ class HomeBox(hippo.CanvasBox, hippo.CanvasItem):
style.apply_stylesheet(self._my_icon, 'home.MyIcon')
self.append(self._my_icon, hippo.PACK_FIXED)
shell.get_model().connect('notify::state',
self._shell_state_changed_cb)
def _shell_state_changed_cb(self, model, pspec):
# FIXME handle all possible mode switches
if model.props.state == ShellModel.STATE_SHUTDOWN:
if self._donut:
self.remove(self._donut)
self._donut = None
self._my_icon.props.color = IconColor('insensitive')
def do_allocate(self, width, height):
hippo.CanvasBox.do_allocate(self, width, height)