2006-08-23 11:52:18 +02:00
|
|
|
import gtk
|
2006-08-29 00:30:19 +02:00
|
|
|
import gobject
|
2006-08-23 11:52:18 +02:00
|
|
|
|
2006-09-01 15:11:52 +02:00
|
|
|
from frame.BottomPanel import BottomPanel
|
|
|
|
from frame.RightPanel import RightPanel
|
|
|
|
from frame.TopPanel import TopPanel
|
|
|
|
from frame.Panel import Panel
|
2006-08-23 11:52:18 +02:00
|
|
|
|
2006-09-01 15:11:52 +02:00
|
|
|
class Frame:
|
2006-08-30 12:22:01 +02:00
|
|
|
def __init__(self, shell, owner):
|
2006-08-23 11:52:18 +02:00
|
|
|
size = 30
|
|
|
|
|
2006-09-01 15:11:52 +02:00
|
|
|
self._verbs_panel = BottomPanel(shell)
|
2006-08-28 16:53:29 +02:00
|
|
|
self._verbs_panel.set_position(size, 0)
|
2006-08-28 21:52:02 +02:00
|
|
|
self._verbs_panel.move(0, gtk.gdk.screen_height() - size)
|
|
|
|
self._verbs_panel.resize(gtk.gdk.screen_width(), size)
|
2006-08-23 11:52:18 +02:00
|
|
|
|
2006-09-01 15:11:52 +02:00
|
|
|
self._friends_panel = RightPanel(shell, owner.get_friends())
|
2006-08-28 16:53:29 +02:00
|
|
|
self._friends_panel.move(gtk.gdk.screen_width() - size, size)
|
2006-08-28 21:52:02 +02:00
|
|
|
self._friends_panel.resize(size, gtk.gdk.screen_height() - size * 2)
|
2006-08-23 11:52:18 +02:00
|
|
|
|
2006-08-28 14:04:51 +02:00
|
|
|
self._top_panel = TopPanel(shell)
|
2006-08-28 16:53:29 +02:00
|
|
|
self._top_panel.set_position(size, 0)
|
2006-08-28 21:52:02 +02:00
|
|
|
self._top_panel.move(0, 0)
|
|
|
|
self._top_panel.resize(gtk.gdk.screen_width(), size)
|
2006-08-28 16:53:29 +02:00
|
|
|
|
|
|
|
self._left_panel = Panel()
|
|
|
|
self._left_panel.move(0, size)
|
2006-08-28 21:52:02 +02:00
|
|
|
self._left_panel.resize(size, gtk.gdk.screen_height() - size * 2)
|
2006-08-28 16:53:29 +02:00
|
|
|
|
2006-08-29 00:30:19 +02:00
|
|
|
def __hide_timeout_cb(self):
|
|
|
|
self.hide()
|
|
|
|
return False
|
|
|
|
|
|
|
|
def show_and_hide(self, seconds):
|
|
|
|
self.show()
|
|
|
|
gobject.timeout_add(seconds * 1000, self.__hide_timeout_cb)
|
|
|
|
|
2006-08-28 16:53:29 +02:00
|
|
|
def show(self):
|
|
|
|
self._verbs_panel.show()
|
|
|
|
self._friends_panel.show()
|
2006-08-28 14:04:51 +02:00
|
|
|
self._top_panel.show()
|
2006-08-28 16:53:29 +02:00
|
|
|
self._left_panel.show()
|
|
|
|
|
|
|
|
def hide(self):
|
|
|
|
self._verbs_panel.hide()
|
|
|
|
self._friends_panel.hide()
|
|
|
|
self._top_panel.hide()
|
|
|
|
self._left_panel.hide()
|
2006-08-23 11:52:18 +02:00
|
|
|
|
2006-08-28 16:53:29 +02:00
|
|
|
def toggle_visibility(self):
|
|
|
|
if self._verbs_panel.props.visible:
|
|
|
|
self.hide()
|
|
|
|
else:
|
|
|
|
self.show()
|