diff options
Diffstat (limited to 'src/view/home/FriendsBox.py')
-rw-r--r-- | src/view/home/FriendsBox.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/view/home/FriendsBox.py b/src/view/home/FriendsBox.py index 8c6ddcf..c45c1c6 100644 --- a/src/view/home/FriendsBox.py +++ b/src/view/home/FriendsBox.py @@ -50,7 +50,7 @@ class FriendsBox(hippo.Canvas): palette = Palette(None, primary_text=profile.get_nick_name(), icon=palette_icon) self._owner_icon.set_palette(palette) - self._layout.add_center(self._owner_icon) + self._layout.add(self._owner_icon) friends = shellmodel.get_instance().get_friends() @@ -75,3 +75,15 @@ class FriendsBox(hippo.Canvas): del self._friends[key] icon.destroy() + def do_size_allocate(self, allocation): + width = allocation.width + height = allocation.height + + min_w_, icon_width = self._owner_icon.get_width_request() + min_h_, icon_height = self._owner_icon.get_height_request(icon_width) + x = (width - icon_width) / 2 + y = (height - icon_height) / 2 + self._layout.move(self._owner_icon, x, y) + + hippo.Canvas.do_size_allocate(self, allocation) + |