mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Viewer: Add a shortcut (Ctrl+F11) to toggle the toolbar
This commit is contained in:
parent
ce81764353
commit
5fbfe3fb36
@ -301,6 +301,12 @@ def add_standalone_viewer_shortcuts():
|
|||||||
_('Print book to PDF'),
|
_('Print book to PDF'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
sc['toggle_toolbar'] = desc(
|
||||||
|
"Ctrl+F11",
|
||||||
|
'ui',
|
||||||
|
_('Toggle the toolbar'),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def create_shortcut_map(custom_shortcuts):
|
def create_shortcut_map(custom_shortcuts):
|
||||||
ans = {}
|
ans = {}
|
||||||
|
@ -350,6 +350,8 @@ class View:
|
|||||||
ui_operations.toggle_full_screen()
|
ui_operations.toggle_full_screen()
|
||||||
elif data.name is 'toggle_paged_mode':
|
elif data.name is 'toggle_paged_mode':
|
||||||
self.toggle_paged_mode()
|
self.toggle_paged_mode()
|
||||||
|
elif data.name is 'toggle_toolbar':
|
||||||
|
self.toggle_toolbar()
|
||||||
elif data.name is 'quit':
|
elif data.name is 'quit':
|
||||||
ui_operations.quit()
|
ui_operations.quit()
|
||||||
elif data.name is 'start_search':
|
elif data.name is 'start_search':
|
||||||
@ -404,6 +406,12 @@ class View:
|
|||||||
sd.set('read_mode', new_mode)
|
sd.set('read_mode', new_mode)
|
||||||
ui_operations.redisplay_book()
|
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):
|
def find(self, text, backwards):
|
||||||
self.iframe_wrapper.send_message('find', text=text, backwards=backwards, searched_in_spine=False)
|
self.iframe_wrapper.send_message('find', text=text, backwards=backwards, searched_in_spine=False)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user