diff options
author | Raul Gutierrez Segales <rgs@collabora.co.uk> | 2011-09-11 15:56:12 (GMT) |
---|---|---|
committer | Simon Schampijer <simon@laptop.org> | 2011-09-12 10:32:44 (GMT) |
commit | 0e073abac8b9d30e399d2ae982d0f0b3d2720f30 (patch) | |
tree | df9e67b622de62b20e7206dccc678e657a081246 | |
parent | 8ac4912b634f5fdb808f616da51b95c61b62f259 (diff) |
Make Mesh View work without Hippo and with the new Icon
I've added a couple of calls to show here and there. This should
be cleaned up and done in ordered fashion.
Also, the whole dance with desktop.Grid passing in icons to
get them positioned is kinda confusing because width/height is
converted on its way to the Grid and on its way out: very error
prone stuff.
-rw-r--r-- | src/jarabe/desktop/meshbox.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/jarabe/desktop/meshbox.py b/src/jarabe/desktop/meshbox.py index 941869f..9728a12 100644 --- a/src/jarabe/desktop/meshbox.py +++ b/src/jarabe/desktop/meshbox.py @@ -115,6 +115,7 @@ class ActivityView(gtk.VBox): self._icons = {} self._icon = self._create_icon() + self._icon.show() self.add(self._icon) self._icon.palette_invoker.cache_palette = False @@ -423,6 +424,7 @@ class MeshContainer(gtk.Container): self._grid.move(child, x / _CELL_SIZE, y / _CELL_SIZE, locked=True) def add(self, icon): + icon.show() width, height = self._get_child_grid_size(icon) self._grid.add(icon, width, height) if icon.flags() & gtk.REALIZED: @@ -466,7 +468,11 @@ class MeshContainer(gtk.Container): for child in self._grid.get_children(): rect = self._grid.get_child_rect(child) - child.size_allocate(rect) + # FIXME: the + 1 is because the XO man's head is being cut off, now idea why. + nrect = gtk.gdk.Rectangle(int(rect.x * _CELL_SIZE), int(rect.y * _CELL_SIZE), + int(rect.width * _CELL_SIZE),int(rect.height * _CELL_SIZE) + 1) + + child.size_allocate(nrect) def _get_child_grid_size(self, child): width, height = child.size_request() @@ -533,6 +539,7 @@ class MeshBox(gtk.VBox): gtk.VBox.do_size_allocate(self, allocation) self._mesh_container.do_size_allocate(allocation) + gtk.VBox.do_size_allocate(self, allocation) def _buddy_added_cb(self, model, buddy_model): self._add_buddy(buddy_model) @@ -552,6 +559,7 @@ class MeshBox(gtk.VBox): if buddy_model.props.current_activity is not None: return icon = BuddyIcon(buddy_model) + icon.show() if buddy_model.is_owner(): self._owner_icon = icon self._mesh_container.add(icon) @@ -578,6 +586,7 @@ class MeshBox(gtk.VBox): def _add_activity(self, activity_model): icon = ActivityView(activity_model) + icon.show() self._mesh_container.add(icon) if hasattr(icon, 'set_filter'): |