From 780a2b5a59d9f719ca7b3a126c973857c47ea4f0 Mon Sep 17 00:00:00 2001 From: Manuel QuiƱones Date: Fri, 09 Nov 2012 13:21:11 +0000 Subject: 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 Acked-by: Simon Schampijer --- 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) -- cgit v0.9.1