Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2006-09-25 14:40:15 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2006-09-25 14:40:15 (GMT)
commit2ee61e447569e31d2bc5ba67ac624d4b1f63752a (patch)
treebfc629ff6261bbd2a1cba4e01b52359427d01fe9 /sugar
parente31bcc76b3fec3d3311f32ffb4e324693a26db84 (diff)
Show activities again
Diffstat (limited to 'sugar')
-rw-r--r--sugar/canvas/SnowflakeLayout.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/sugar/canvas/SnowflakeLayout.py b/sugar/canvas/SnowflakeLayout.py
index aae7d07..9a0c709 100644
--- a/sugar/canvas/SnowflakeLayout.py
+++ b/sugar/canvas/SnowflakeLayout.py
@@ -11,6 +11,7 @@ class SnowflakeLayout:
def __init__(self):
self._root = None
self._children = []
+ self._size = 0
def set_root(self, icon):
self._root = icon
@@ -27,7 +28,7 @@ class SnowflakeLayout:
[width, height] = self._root.get_size_request()
matrix = cairo.Matrix(1, 0, 0, 1, 0, 0)
- matrix.translate(self._cx, self._cy)
+ matrix.translate(self._cx - (width / 2), self._cy - (height / 2))
self._root.set_transform(matrix)
def _layout_child(self, child, index):
@@ -44,15 +45,17 @@ class SnowflakeLayout:
matrix.translate(x, y)
child.set_transform(matrix)
+ def get_size(self):
+ return self._size
+
def _layout(self):
self._r = SnowflakeLayout._BASE_RADIUS + \
SnowflakeLayout._CHILDREN_FACTOR * len(self._children)
+ self._size = self._r * 2 + SnowflakeLayout._BORDER + \
+ SnowflakeLayout._FLAKE_DISTANCE * 2
- c = self._r + SnowflakeLayout._BORDER + \
- SnowflakeLayout._FLAKE_DISTANCE * 2
-
- self._cx = c
- self._cy = c
+ self._cx = self._size / 2
+ self._cy = self._size / 2
self._layout_root()