Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Quiñones <manuq@laptop.org>2012-11-09 13:21:11 (GMT)
committer Manuel Quiñones <manuq@laptop.org>2012-11-09 19:37:00 (GMT)
commit780a2b5a59d9f719ca7b3a126c973857c47ea4f0 (patch)
treec03a7e021da8e4541c227dd742cf9eb756b41cda
parent7f46bb3dbaf514b18d6cb567f54ce95fb674ad93 (diff)
Snowflake layout: fix the requisition and allocation - SL #4157
Same as commit c5582856, size_request is deprecated and the get_preferred* should be used instead. So we need to implement do_get_preferred_size instead of do_size_request. Signed-off-by: Manuel Quiñones <manuq@laptop.org> Acked-by: Simon Schampijer <simon@laptop.org>
-rw-r--r--src/jarabe/desktop/favoriteslayout.py2
-rw-r--r--src/jarabe/desktop/snowflakelayout.py12
2 files changed, 12 insertions, 2 deletions
diff --git a/src/jarabe/desktop/favoriteslayout.py b/src/jarabe/desktop/favoriteslayout.py
index 5f3b560..635a534 100644
--- a/src/jarabe/desktop/favoriteslayout.py
+++ b/src/jarabe/desktop/favoriteslayout.py
@@ -175,7 +175,7 @@ class SpreadLayout(ViewLayout):
width, height = self._get_child_grid_size(child)
self._grid.add(child, width, height, None, None, locked=False)
- requisition = child.size_request()
+ requisition = child.get_preferred_size()[0]
rect = self._grid.get_child_rect(child)
child_allocation = Gdk.Rectangle()
child_allocation.x = int(round(rect.x * _CELL_SIZE))
diff --git a/src/jarabe/desktop/snowflakelayout.py b/src/jarabe/desktop/snowflakelayout.py
index 5ad5f26..9f47912 100644
--- a/src/jarabe/desktop/snowflakelayout.py
+++ b/src/jarabe/desktop/snowflakelayout.py
@@ -71,10 +71,20 @@ class SnowflakeLayout(Gtk.Container):
del self._children[child]
self.remove(child)
- def do_size_request(self, requisition):
+ def do_get_preferred_size(self):
size = self._calculate_size()
+ requisition = Gtk.Requisition()
requisition.width = size
requisition.height = size
+ return (requisition, requisition)
+
+ def do_get_preferred_width(self):
+ size = self._calculate_size()
+ return (size, size)
+
+ def do_get_preferred_height(self):
+ size = self._calculate_size()
+ return (size, size)
def do_size_allocate(self, allocation):
self.set_allocation(allocation)