Viewer: Add a shortcut (Ctrl+F11) to toggle the toolbar

This commit is contained in:
Kovid Goyal 2019-11-09 09:07:20 +05:30
parent ce81764353
commit 5fbfe3fb36
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 14 additions and 0 deletions

View File

@ -301,6 +301,12 @@ def add_standalone_viewer_shortcuts():
_('Print book to PDF'),
)
sc['toggle_toolbar'] = desc(
"Ctrl+F11",
'ui',
_('Toggle the toolbar'),
)
def create_shortcut_map(custom_shortcuts):
ans = {}

View File

@ -350,6 +350,8 @@ class View:
ui_operations.toggle_full_screen()
elif data.name is 'toggle_paged_mode':
self.toggle_paged_mode()
elif data.name is 'toggle_toolbar':
self.toggle_toolbar()
elif data.name is 'quit':
ui_operations.quit()
elif data.name is 'start_search':
@ -404,6 +406,12 @@ class View:
sd.set('read_mode', new_mode)
ui_operations.redisplay_book()
def toggle_toolbar(self):
sd = get_session_data()
misc = sd.get('standalone_misc_settings')
misc.show_actions_toolbar = v'!misc.show_actions_toolbar'
sd.set('standalone_misc_settings', misc)
def find(self, text, backwards):
self.iframe_wrapper.send_message('find', text=text, backwards=backwards, searched_in_spine=False)