focus the canvas
make the boxes private using the python mangling algorithm (see pep8)
This commit is contained in:
parent
cdd4ba3a3d
commit
b087809ec5
@ -96,20 +96,20 @@ class Window(gtk.Window):
|
|||||||
self._canvas = None
|
self._canvas = None
|
||||||
self.tray = None
|
self.tray = None
|
||||||
|
|
||||||
self._vbox = gtk.VBox()
|
self.__vbox = gtk.VBox()
|
||||||
self._hbox = gtk.HBox()
|
self.__hbox = gtk.HBox()
|
||||||
self._vbox.pack_start(self._hbox)
|
self.__vbox.pack_start(self.__hbox)
|
||||||
self._hbox.show()
|
self.__hbox.show()
|
||||||
|
|
||||||
self._event_box = gtk.EventBox()
|
self._event_box = gtk.EventBox()
|
||||||
self._hbox.pack_start(self._event_box)
|
self.__hbox.pack_start(self._event_box)
|
||||||
self._event_box.show()
|
self._event_box.show()
|
||||||
self._event_box.add_events(gtk.gdk.POINTER_MOTION_HINT_MASK
|
self._event_box.add_events(gtk.gdk.POINTER_MOTION_HINT_MASK
|
||||||
| gtk.gdk.POINTER_MOTION_MASK)
|
| gtk.gdk.POINTER_MOTION_MASK)
|
||||||
self._event_box.connect('motion-notify-event', self.__motion_notify_cb)
|
self._event_box.connect('motion-notify-event', self.__motion_notify_cb)
|
||||||
|
|
||||||
self.add(self._vbox)
|
self.add(self.__vbox)
|
||||||
self._vbox.show()
|
self.__vbox.show()
|
||||||
|
|
||||||
self._is_fullscreen = False
|
self._is_fullscreen = False
|
||||||
self._unfullscreen_button = UnfullscreenButton()
|
self._unfullscreen_button = UnfullscreenButton()
|
||||||
@ -126,6 +126,7 @@ class Window(gtk.Window):
|
|||||||
self._event_box.add(canvas)
|
self._event_box.add(canvas)
|
||||||
|
|
||||||
self._canvas = canvas
|
self._canvas = canvas
|
||||||
|
self.__vbox.set_focus_child(self._canvas)
|
||||||
|
|
||||||
def get_canvas(self):
|
def get_canvas(self):
|
||||||
return self._canvas
|
return self._canvas
|
||||||
@ -137,10 +138,10 @@ class Window(gtk.Window):
|
|||||||
|
|
||||||
def set_toolbar_box(self, toolbar_box):
|
def set_toolbar_box(self, toolbar_box):
|
||||||
if self._toolbar_box:
|
if self._toolbar_box:
|
||||||
self._vbox.remove(self._toolbar_box)
|
self.__vbox.remove(self._toolbar_box)
|
||||||
|
|
||||||
self._vbox.pack_start(toolbar_box, False)
|
self.__vbox.pack_start(toolbar_box, False)
|
||||||
self._vbox.reorder_child(toolbar_box, 0)
|
self.__vbox.reorder_child(toolbar_box, 0)
|
||||||
|
|
||||||
self._toolbar_box = toolbar_box
|
self._toolbar_box = toolbar_box
|
||||||
|
|
||||||
@ -152,35 +153,35 @@ class Window(gtk.Window):
|
|||||||
box.remove(self.tray)
|
box.remove(self.tray)
|
||||||
|
|
||||||
if position == gtk.POS_LEFT:
|
if position == gtk.POS_LEFT:
|
||||||
self._hbox.pack_start(tray, False)
|
self.__hbox.pack_start(tray, False)
|
||||||
elif position == gtk.POS_RIGHT:
|
elif position == gtk.POS_RIGHT:
|
||||||
self._hbox.pack_end(tray, False)
|
self.__hbox.pack_end(tray, False)
|
||||||
elif position == gtk.POS_BOTTOM:
|
elif position == gtk.POS_BOTTOM:
|
||||||
self._vbox.pack_end(tray, False)
|
self.__vbox.pack_end(tray, False)
|
||||||
|
|
||||||
self.tray = tray
|
self.tray = tray
|
||||||
|
|
||||||
def add_alert(self, alert):
|
def add_alert(self, alert):
|
||||||
self._alerts.append(alert)
|
self._alerts.append(alert)
|
||||||
if len(self._alerts) == 1:
|
if len(self._alerts) == 1:
|
||||||
self._vbox.pack_start(alert, False)
|
self.__vbox.pack_start(alert, False)
|
||||||
if self._toolbar_box is not None:
|
if self._toolbar_box is not None:
|
||||||
self._vbox.reorder_child(alert, 1)
|
self.__vbox.reorder_child(alert, 1)
|
||||||
else:
|
else:
|
||||||
self._vbox.reorder_child(alert, 0)
|
self.__vbox.reorder_child(alert, 0)
|
||||||
|
|
||||||
def remove_alert(self, alert):
|
def remove_alert(self, alert):
|
||||||
if alert in self._alerts:
|
if alert in self._alerts:
|
||||||
self._alerts.remove(alert)
|
self._alerts.remove(alert)
|
||||||
# if the alert is the visible one on top of the queue
|
# if the alert is the visible one on top of the queue
|
||||||
if alert.get_parent() is not None:
|
if alert.get_parent() is not None:
|
||||||
self._vbox.remove(alert)
|
self.__vbox.remove(alert)
|
||||||
if len(self._alerts) >= 1:
|
if len(self._alerts) >= 1:
|
||||||
self._vbox.pack_start(self._alerts[0], False)
|
self.__vbox.pack_start(self._alerts[0], False)
|
||||||
if self._toolbar_box is not None:
|
if self._toolbar_box is not None:
|
||||||
self._vbox.reorder_child(self._alerts[0], 1)
|
self.__vbox.reorder_child(self._alerts[0], 1)
|
||||||
else:
|
else:
|
||||||
self._vbox.reorder_child(self._alert[0], 0)
|
self.__vbox.reorder_child(self._alert[0], 0)
|
||||||
|
|
||||||
def __window_realize_cb(self, window):
|
def __window_realize_cb(self, window):
|
||||||
group = gtk.Window()
|
group = gtk.Window()
|
||||||
|
Loading…
Reference in New Issue
Block a user