From 2df96b9af7d34b111bcb1c306724e4c0cf2cf62f Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Wed, 31 Oct 2007 17:29:18 +0000 Subject: Better layout strategy for the home. Should fix positioning of the devices. --- (limited to 'shell/view/home/HomeBox.py') diff --git a/shell/view/home/HomeBox.py b/shell/view/home/HomeBox.py index a931ec8..f568366 100644 --- a/shell/view/home/HomeBox.py +++ b/shell/view/home/HomeBox.py @@ -48,14 +48,23 @@ class HomeBox(hippo.CanvasBox, hippo.CanvasItem): shell_model = shell.get_model() + top_box = hippo.CanvasBox(box_height=style.GRID_CELL_SIZE * 2.5) + self.append(top_box) + + center_box = hippo.CanvasBox(yalign=hippo.ALIGNMENT_CENTER) + self.append(center_box, hippo.PACK_EXPAND) + + bottom_box = hippo.CanvasBox(box_height=style.GRID_CELL_SIZE * 2.5) + self.append(bottom_box) + self._donut = ActivitiesDonut(shell) - self.append(self._donut, hippo.PACK_FIXED) + center_box.append(self._donut) self._my_icon = _MyIcon(shell, style.XLARGE_ICON_SIZE) self.append(self._my_icon, hippo.PACK_FIXED) self._devices_box = _DevicesBox(shell_model.get_devices()) - self.append(self._devices_box, hippo.PACK_FIXED) + bottom_box.append(self._devices_box) shell_model.connect('notify::state', self._shell_state_changed_cb) @@ -68,17 +77,9 @@ class HomeBox(hippo.CanvasBox, hippo.CanvasItem): def do_allocate(self, width, height, origin_changed): hippo.CanvasBox.do_allocate(self, width, height, origin_changed) - [donut_width, donut_height] = self._donut.get_allocation() - self.set_position(self._donut, (width - donut_width) / 2, - (height - donut_height) / 2) - [icon_width, icon_height] = self._my_icon.get_allocation() self.set_position(self._my_icon, (width - icon_width) / 2, (height - icon_height) / 2) - - [box_width, box_height] = self._devices_box.get_allocation() - self.set_position(self._devices_box, (width - icon_width) / 2, - height - style.GRID_CELL_SIZE * 2.5) _REDRAW_TIMEOUT = 5 * 60 * 1000 # 5 minutes -- cgit v0.9.1