diff options
author | Manuel Quiñones <manuq@laptop.org> | 2012-10-03 18:09:32 (GMT) |
---|---|---|
committer | Manuel Quiñones <manuq@laptop.org> | 2012-10-05 13:02:14 (GMT) |
commit | c558285618cf6dc2c72d70ca373a4aa69f901325 (patch) | |
tree | 550fecbf1c6737aa3a6c363e8e0443ee9abb4ddb | |
parent | 8cedf0f47c0a1db544d928e4ebbea21d3e64e2b8 (diff) |
Get back spacing between activity icon and hover border
size_request is deprecated and get_preferred_size should be used
instead. We override the methods of EventIcon get_preferred_width and
get_preferred_height because they are simpler to use from python, no
need to make a requisition object, just return integers.
Signed-off-by: Manuel Quiñones <manuq@laptop.org>
Acked-by: Simon Schampijer <simon@laptop.org>
-rw-r--r-- | src/jarabe/desktop/favoriteslayout.py | 7 | ||||
-rw-r--r-- | src/jarabe/desktop/favoritesview.py | 13 |
2 files changed, 13 insertions, 7 deletions
diff --git a/src/jarabe/desktop/favoriteslayout.py b/src/jarabe/desktop/favoriteslayout.py index c2bf8f5..e9f614e 100644 --- a/src/jarabe/desktop/favoriteslayout.py +++ b/src/jarabe/desktop/favoriteslayout.py @@ -380,13 +380,14 @@ class RingLayout(ViewLayout): x, y = self._calculate_position(radius, icon_size, n, len(children), allocation.width, allocation.height) - child.size_request() child.set_size(icon_size) + new_width = child.get_preferred_width()[0] + new_height = child.get_preferred_height()[0] child_allocation = Gdk.Rectangle() child_allocation.x = allocation.x + x child_allocation.y = allocation.y + y - child_allocation.width = icon_size - child_allocation.height = icon_size + child_allocation.width = new_width + child_allocation.height = new_height child.size_allocate(child_allocation) def compare_activities(self, icon_a, icon_b): diff --git a/src/jarabe/desktop/favoritesview.py b/src/jarabe/desktop/favoritesview.py index cfe18eb..b727e0e 100644 --- a/src/jarabe/desktop/favoritesview.py +++ b/src/jarabe/desktop/favoritesview.py @@ -447,10 +447,15 @@ class ActivityIcon(EventIcon): allocation.width, allocation.height) - def do_size_request(self, req): - EventIcon.do_size_request(self, req) - req.height += ActivityIcon._BORDER_WIDTH * 2 - req.width += ActivityIcon._BORDER_WIDTH * 2 + def do_get_preferred_width(self): + width = EventIcon.do_get_preferred_width(self)[0] + width += ActivityIcon._BORDER_WIDTH * 2 + return (width, width) + + def do_get_preferred_height(self): + height = EventIcon.do_get_preferred_height(self)[0] + height += ActivityIcon._BORDER_WIDTH * 2 + return (height, height) def __button_release_event_cb(self, icon, event): self._activate() |