diff options
Diffstat (limited to 'shell/view/home/snowflakelayout.py')
-rw-r--r-- | shell/view/home/snowflakelayout.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/shell/view/home/snowflakelayout.py b/shell/view/home/snowflakelayout.py index 7e59bf2..1eb58cf 100644 --- a/shell/view/home/snowflakelayout.py +++ b/shell/view/home/snowflakelayout.py @@ -31,18 +31,21 @@ class SnowflakeLayout(gobject.GObject,hippo.CanvasLayout): gobject.GObject.__init__(self) self._nflakes = 0 - def add(self, child): + def add(self, child, center=False): + if not center: + self._nflakes += 1 + self._box.append(child) box_child = self._box.find_box_child(child) - box_child.is_center = False - - self._nflakes += 1 + box_child.is_center = center - def add_center(self, child): - self._box.append(child) + def remove(self, child): box_child = self._box.find_box_child(child) - box_child.is_center = True + if not box_child.is_center: + self._nflakes -= 1 + + self._box.remove(child) def do_set_box(self, box): self._box = box |