Fix #1872518 [[Enhancement] Hide shown pages when clicking in the viewer toolbar](https://bugs.launchpad.net/calibre/+bug/1872518)

This commit is contained in:
Kovid Goyal 2020-04-16 19:36:59 +05:30
parent b468f72ba7
commit 244d0a2701
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 7 additions and 1 deletions

View File

@ -59,7 +59,7 @@ def all_actions():
'reference': Action('reference.png', _('Toggle Reference mode'), 'toggle_reference_mode'),
'autoscroll': Action('auto-scroll.png', _('Toggle auto-scrolling'), 'toggle_autoscroll'),
'lookup': Action('generic-library.png', _('Lookup words'), 'toggle_lookup'),
'chrome': Action('tweaks.png', _('Show viewer controls'), 'show_chrome'),
'chrome': Action('tweaks.png', _('Show viewer controls'), 'show_chrome_force'),
'mode': Action('scroll.png', _('Toggle paged mode'), 'toggle_paged_mode'),
'print': Action('print.png', _('Print book'), 'print'),
'preferences': Action('config.png', _('Preferences'), 'preferences'),

View File

@ -421,6 +421,8 @@ class View:
window.history.forward()
elif data.name is 'show_chrome':
self.show_chrome()
elif data.name is 'show_chrome_force':
self.show_chrome_force()
elif data.name is 'toggle_toc':
ui_operations.toggle_toc()
elif data.name is 'toggle_bookmarks':
@ -590,6 +592,10 @@ class View:
initial_panel = data?.initial_panel or None
self.get_current_cfi('show-chrome', self.do_show_chrome.bind(None, elements, initial_panel))
def show_chrome_force(self):
self.hide_overlays()
self.show_chrome()
def do_show_chrome(self, elements, initial_panel, request_id, cfi_data):
self.hide_overlays()
self.update_cfi_data(cfi_data)