Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rw-r--r--shell/view/home/snowflakelayout.py27
2 files changed, 15 insertions, 13 deletions
diff --git a/NEWS b/NEWS
index be8905a..59368e3 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,4 @@
+* #3053: Fix the distance between the clustered xos and the activity. (marco)
* Make the sizes of mesh icons match Eben spec. (marco)
* #3364: When joining an activity, pick up its sharing scope, so we don't
try to re-share already shared activities in order to invite someone (smcv)
diff --git a/shell/view/home/snowflakelayout.py b/shell/view/home/snowflakelayout.py
index 7db39a6..7e59bf2 100644
--- a/shell/view/home/snowflakelayout.py
+++ b/shell/view/home/snowflakelayout.py
@@ -22,8 +22,8 @@ import hippo
from sugar.graphics import style
-_BASE_RADIUS = style.zoom(25)
-_CHILDREN_FACTOR = 1
+_BASE_DISTANCE = style.zoom(15)
+_CHILDREN_FACTOR = style.zoom(3)
class SnowflakeLayout(gobject.GObject,hippo.CanvasLayout):
__gtype_name__ = 'SugarSnowflakeLayout'
@@ -52,7 +52,7 @@ class SnowflakeLayout(gobject.GObject,hippo.CanvasLayout):
return (size, size)
def do_get_width_request(self):
- size = self._calculate_size()
+ size = self._calculate_size()
return (size, size)
def do_allocate(self, x, y, width, height,
@@ -86,19 +86,20 @@ class SnowflakeLayout(gobject.GObject,hippo.CanvasLayout):
index += 1
def _get_radius(self):
- return int(_BASE_RADIUS + _CHILDREN_FACTOR * self._nflakes)
+ radius = int(_BASE_DISTANCE + _CHILDREN_FACTOR * self._nflakes)
+ for child in self._box.get_layout_children():
+ if child.is_center:
+ [min_w, child_w] = child.get_width_request()
+ [min_h, child_h] = child.get_height_request(child_w)
+ radius += max(child_w, child_h) / 2
+
+ return radius
def _calculate_size(self):
- size = 0
+ thickness = 0
for child in self._box.get_layout_children():
[min_width, child_width] = child.get_width_request()
[min_height, child_height] = child.get_height_request(child_width)
+ thickness = max(thickness, max(child_width, child_height))
- new_size = max(child_width, child_height)
- if not child.is_center:
- new_size += self._get_radius() * 2
-
- if new_size > size:
- size = new_size
-
- return size
+ return self._get_radius() * 2 + thickness