More fixes

This commit is contained in:
Marco Pesenti Gritti 2006-10-06 11:34:29 +02:00
parent 953b5bf286
commit 7f232c30c2

View File

@ -44,7 +44,8 @@ class SnowflakeBox(hippo.CanvasBox, hippo.CanvasItem):
max_child_size = 0 max_child_size = 0
for child in self.get_children(): for child in self.get_children():
[width, height] = child.get_allocation() 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, width)
max_child_size = max (max_child_size, height) max_child_size = max (max_child_size, height)
@ -52,20 +53,19 @@ class SnowflakeBox(hippo.CanvasBox, hippo.CanvasItem):
def do_get_height_request(self, width): def do_get_height_request(self, width):
hippo.CanvasBox.do_get_height_request(self, width) hippo.CanvasBox.do_get_height_request(self, width)
return width return width
def do_allocate(self, width, height): def do_allocate(self, width, height):
self._r = _BASE_RADIUS + _CHILDREN_FACTOR * len(self.get_children())
hippo.CanvasBox.do_allocate(self, width, height) hippo.CanvasBox.do_allocate(self, width, height)
self._cx = width / 2 self._cx = width / 2
self._cy = height / 2 self._cy = height / 2
self._r = _BASE_RADIUS + _CHILDREN_FACTOR * len(self.get_children())
self._layout_root() self._layout_root()
index = 0 index = 0
for child in self.get_children(): for child in self.get_children():
if child != self._root:
self._layout_child(child, index) self._layout_child(child, index)
index += 1 index += 1