Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSimon Schampijer <simon@schampijer.de>2007-10-19 20:48:21 (GMT)
committer Simon Schampijer <simon@schampijer.de>2007-10-19 20:48:21 (GMT)
commit34d935b2afec3dd5c053e63cebf6032f23866c48 (patch)
treedc2e8ee3002f60708ba7d5f4141f1af1ac1792fb /lib
parent5a4ec4f761bea6b24dea42810d399bc377a39973 (diff)
Add a keybinding (alt+space) to activity window to hide/show tray
Diffstat (limited to 'lib')
-rw-r--r--lib/sugar/graphics/window.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/sugar/graphics/window.py b/lib/sugar/graphics/window.py
index b21de1c..bfaad35 100644
--- a/lib/sugar/graphics/window.py
+++ b/lib/sugar/graphics/window.py
@@ -23,6 +23,7 @@ class Window(gtk.Window):
self.connect('realize', self.__window_realize_cb)
self.connect('window-state-event', self.__window_state_event_cb)
+ self.connect('key-press-event', self.__key_press_cb)
self.toolbox = None
self._alerts = []
@@ -106,7 +107,14 @@ class Window(gtk.Window):
self.toolbox.show()
if self.tray is not None:
self.tray.show()
-
+
+ def __key_press_cb(self, widget, event):
+ if event.state & gtk.gdk.MOD1_MASK:
+ if gtk.gdk.keyval_name(event.keyval) == 'space':
+ self.tray.props.visible = not self.tray.props.visible
+ return True
+ return False
+
def get_canvas_screenshot(self):
if not self.canvas:
return None