mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Viewer: add a ashortcut (Ctrl+F11) to show/hide toolbars. Fixes #1664077 [[Enhancement request] Keyboard shortcut for "Show/hide controls"](https://bugs.launchpad.net/calibre/+bug/1664077)
This commit is contained in:
parent
b92e3196ad
commit
8aec078d00
@ -95,4 +95,7 @@ SHORTCUTS = {
|
||||
|
||||
'Print': (['Ctrl+P'],
|
||||
_('Print the current book')),
|
||||
|
||||
'Show/hide controls': (['Ctrl+F11'],
|
||||
_('Show/hide controls')),
|
||||
}
|
||||
|
@ -248,6 +248,9 @@ class EbookViewer(MainWindow):
|
||||
QTimer.singleShot(50, file_events.flush)
|
||||
self.window_mode_changed = None
|
||||
self.toggle_toolbar_action = QAction(_('Show/hide controls'), self)
|
||||
tts = self.view.shortcuts.get_shortcuts('Show/hide controls')
|
||||
if tts:
|
||||
self.toggle_toolbar_action.setText(self.toggle_toolbar_action.text() + '\t' + tts[0])
|
||||
self.toggle_toolbar_action.setCheckable(True)
|
||||
self.toggle_toolbar_action.triggered.connect(self.toggle_toolbars)
|
||||
self.toolbar_hidden = None
|
||||
@ -1107,6 +1110,7 @@ class EbookViewer(MainWindow):
|
||||
'Reload': self.action_reload,
|
||||
'Table of Contents': self.action_table_of_contents,
|
||||
'Print': self.action_print,
|
||||
'Show/hide controls': self.toggle_toolbar_action,
|
||||
}.get(key, None)
|
||||
if action is not None:
|
||||
event.accept()
|
||||
|
Loading…
x
Reference in New Issue
Block a user