diff options
author | Marco Pesenti Gritti <mpg@redhat.com> | 2007-03-14 02:19:24 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <mpg@redhat.com> | 2007-03-14 02:19:24 (GMT) |
commit | 4960ddae252c6b6a41a510b8963d026d9e9b13bc (patch) | |
tree | d4a9c073413c50a740b83075bbfb555edc6a04ae /sugar/graphics/snowflakebox.py | |
parent | 9d8fa7d42ab1f049cc1320c4b1d1700178059348 (diff) |
Adapt to the new hippo canvas sizing API
Diffstat (limited to 'sugar/graphics/snowflakebox.py')
-rw-r--r-- | sugar/graphics/snowflakebox.py | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sugar/graphics/snowflakebox.py b/sugar/graphics/snowflakebox.py index f0d446c..540b8b0 100644 --- a/sugar/graphics/snowflakebox.py +++ b/sugar/graphics/snowflakebox.py @@ -72,17 +72,15 @@ class SnowflakeBox(hippo.CanvasBox, hippo.CanvasItem): max_child_size = 0 for child in self.get_children(): - width = child.get_width_request() - height = child.get_height_request(width) - max_child_size = max (max_child_size, width) - max_child_size = max (max_child_size, height) + [min_w, natural_w] = child.get_width_request() + [min_h, natural_h] = child.get_height_request(width) + max_child_size = max (max_child_size, min_w) + max_child_size = max (max_child_size, min_h) - return self._get_radius() * 2 + \ - max_child_size + _FLAKE_DISTANCE * 2 + width = self._get_radius() * 2 + \ + max_child_size + _FLAKE_DISTANCE * 2 - def do_get_height_request(self, width): - hippo.CanvasBox.do_get_height_request(self, width) - return width + return [width, width] def do_allocate(self, width, height, origin_changed): hippo.CanvasBox.do_allocate(self, width, height, origin_changed) |