diff --git a/shell/frame/Frame.py b/shell/frame/Frame.py index d62480f0..d0496552 100644 --- a/shell/frame/Frame.py +++ b/shell/frame/Frame.py @@ -10,23 +10,29 @@ class Frame: def __init__(self, shell, owner): size = 30 - self._verbs_panel = BottomPanel(shell) - self._verbs_panel.set_position(size, 0) - self._verbs_panel.move(0, gtk.gdk.screen_height() - size) - self._verbs_panel.resize(gtk.gdk.screen_width(), size) + self._panels = [] - self._friends_panel = RightPanel(shell, owner.get_friends()) - self._friends_panel.move(gtk.gdk.screen_width() - size, size) - self._friends_panel.resize(size, gtk.gdk.screen_height() - size * 2) + panel = BottomPanel(shell) + panel.set_position(size, 0) + panel.move(0, gtk.gdk.screen_height() - size) + panel.resize(gtk.gdk.screen_width(), size) + self._panels.append(panel) - self._top_panel = TopPanel(shell) - self._top_panel.set_position(size, 0) - self._top_panel.move(0, 0) - self._top_panel.resize(gtk.gdk.screen_width(), size) + panel = RightPanel(shell, owner.get_friends()) + panel.move(gtk.gdk.screen_width() - size, size) + panel.resize(size, gtk.gdk.screen_height() - size * 2) + self._panels.append(panel) - self._left_panel = Panel() - self._left_panel.move(0, size) - self._left_panel.resize(size, gtk.gdk.screen_height() - size * 2) + panel = TopPanel(shell) + panel.set_position(size, 0) + panel.move(0, 0) + panel.resize(gtk.gdk.screen_width(), size) + self._panels.append(panel) + + panel = Panel() + panel.move(0, size) + panel.resize(size, gtk.gdk.screen_height() - size * 2) + self._panels.append(panel) def __hide_timeout_cb(self): self.hide() @@ -37,19 +43,16 @@ class Frame: gobject.timeout_add(seconds * 1000, self.__hide_timeout_cb) def show(self): - self._verbs_panel.show() - self._friends_panel.show() - self._top_panel.show() - self._left_panel.show() + for panel in self._panels: + panel.show() def hide(self): - self._verbs_panel.hide() - self._friends_panel.hide() - self._top_panel.hide() - self._left_panel.hide() + for panel in self._panels: + panel.hide() def toggle_visibility(self): - if self._verbs_panel.props.visible: - self.hide() - else: - self.show() + for panel in self._panels: + if panel.props.visible: + panel.hide() + else: + panel.show()