diff --git a/shell/frame/BottomPanel.py b/shell/frame/BottomPanel.py index caadc78b..620263ff 100644 --- a/shell/frame/BottomPanel.py +++ b/shell/frame/BottomPanel.py @@ -7,7 +7,7 @@ from sugar.canvas.IconItem import IconItem from sugar.canvas.IconColor import IconColor from sugar.presence import PresenceService from sugar.canvas.GridLayout import GridGroup -from sugar.canvas.GridLayout import GridConstraints +from sugar.canvas.GridBox import GridBox class ActivityItem(IconItem): def __init__(self, activity): @@ -33,9 +33,9 @@ class InviteItem(IconItem): def get_bundle_id(self): return self._invite.get_bundle_id() -class BottomPanel(GridGroup): +class BottomPanel(GridBox): def __init__(self, shell, invites): - GridGroup.__init__(self, 16, 1) + GridBox.__init__(self, GridBox.HORIZONTAL, 14, 6) self._shell = shell @@ -67,19 +67,9 @@ class BottomPanel(GridGroup): item = ActivityItem(activity) item.connect('clicked', self.__activity_clicked_cb) - - col = self.get_n_children() + 1 - constraints = GridConstraints(col, 0, 1, 1, 6) - self._layout.set_constraints(item, constraints) - self.add_child(item) def add_invite(self, invite): item = InviteItem(invite) item.connect('clicked', self.__invite_clicked_cb) - - col = self.get_n_children() + 1 - constraints = GridConstraints(col, 0, 1, 1, 6) - self._layout.set_constraints(item, constraints) - self.add_child(item) diff --git a/shell/frame/Frame.py b/shell/frame/Frame.py index d1a13101..df9ecfd9 100644 --- a/shell/frame/Frame.py +++ b/shell/frame/Frame.py @@ -37,11 +37,10 @@ class Frame: layout.set_constraints(panel, constraints) self._model.add(panel) - constraints = GridConstraints(0, 11, 16, 1) - self._create_window(constraints) + self._create_window(GridConstraints(0, 11, 16, 1)) panel = BottomPanel(shell, owner.get_invites()) - layout.set_constraints(panel, constraints) + layout.set_constraints(panel, GridConstraints(1, 11, 14, 1)) self._model.add(panel) # Left diff --git a/shell/frame/RightPanel.py b/shell/frame/RightPanel.py index 818e8c8b..d66c7115 100644 --- a/shell/frame/RightPanel.py +++ b/shell/frame/RightPanel.py @@ -4,12 +4,12 @@ from frame.PanelWindow import PanelWindow from sugar.canvas.IconItem import IconItem from sugar.canvas.IconColor import IconColor from sugar.canvas.GridLayout import GridGroup -from sugar.canvas.GridLayout import GridConstraints +from sugar.canvas.GridBox import GridBox from sugar.presence import PresenceService -class RightPanel(GridGroup): +class RightPanel(GridBox): def __init__(self, shell, friends): - GridGroup.__init__(self, 1, 10) + GridBox.__init__(self, GridBox.VERTICAL, 10, 6) self._shell = shell self._friends = friends self._activity_ps = None @@ -27,11 +27,6 @@ class RightPanel(GridGroup): icon = IconItem(icon_name='stock-buddy', color=IconColor(buddy.get_color())) icon.connect('clicked', self.__buddy_clicked_cb, buddy) - - row = self.get_n_children() - constraints = GridConstraints(0, row , 1, 1, 6) - self._layout.set_constraints(icon, constraints) - self.add_child(icon) self._buddies[buddy.get_name()] = icon