Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/view/home/HomeBox.py
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpg@redhat.com>2007-10-31 17:29:18 (GMT)
committer Marco Pesenti Gritti <mpg@redhat.com>2007-10-31 17:29:18 (GMT)
commit2df96b9af7d34b111bcb1c306724e4c0cf2cf62f (patch)
treed5a543d0a23f7791ca428e5c2bc0aafe196bae2d /shell/view/home/HomeBox.py
parent54ffaaa7f9c09c4825ed46c73a488615200f5318 (diff)
Better layout strategy for the home. Should fix positioning
of the devices.
Diffstat (limited to 'shell/view/home/HomeBox.py')
-rw-r--r--shell/view/home/HomeBox.py21
1 files changed, 11 insertions, 10 deletions
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