diff options
author | Florian Zeitz <florob@babelmonkeys.de> | 2017-01-06 04:36:44 +0100 |
---|---|---|
committer | Florian Zeitz <florob@babelmonkeys.de> | 2017-01-31 22:58:42 +0100 |
commit | 882ea5ba6e46b413694d9a74a6aa246d2c7153f5 (patch) | |
tree | 757d464099f7d35eca9ffa20e2f07ef4c38160c0 /voctogui/lib/ui.py | |
parent | b66d7b2d653f65a318d67b413d8680123bf14b25 (diff) |
Add a ShortcutsWindow and tooltips to display accelerators
The GtkShortcutsWindow is shown upon pressing `?`.
This is only available in Gtk+ >= 3.20.
For earlier versions nothing happens.
Diffstat (limited to 'voctogui/lib/ui.py')
-rw-r--r-- | voctogui/lib/ui.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/voctogui/lib/ui.py b/voctogui/lib/ui.py index 63f6c33..7da3ba4 100644 --- a/voctogui/lib/ui.py +++ b/voctogui/lib/ui.py @@ -16,6 +16,8 @@ from lib.toolbar.composition import CompositionToolbarController from lib.toolbar.streamblank import StreamblankToolbarController from lib.toolbar.misc import MiscToolbarController +from lib.shortcuts import show_shortcuts + class Ui(UiBuilder): @@ -92,6 +94,13 @@ class Ui(UiBuilder): uibuilder=self ) + # Setup Shortcuts window + self.win.connect('key-press-event', self.handle_keypress) + + def handle_keypress(self, window, event): + if event.keyval == Gdk.KEY_question: + show_shortcuts(window) + def show(self): self.log.info('Showing Main-Window') self.win.show_all() |