mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Viewer: Fix current reading position not preserved when changing preferences and auto scroll is active. Fixes #1863438 [After adjusting the auto scroll speed I am jumped back in the book](https://bugs.launchpad.net/calibre/+bug/1863438)
CFI should be updated when jumping directly to preferences panel via shortcut
This commit is contained in:
parent
b99756d862
commit
9730226f6e
@ -425,7 +425,7 @@ class View:
|
||||
elif data.name is 'print':
|
||||
ui_operations.print_book()
|
||||
elif data.name is 'preferences':
|
||||
self.overlay.show_prefs()
|
||||
self.show_chrome({'initial_panel': 'show_prefs'})
|
||||
elif data.name is 'metadata':
|
||||
self.overlay.show_metadata()
|
||||
elif data.name is 'goto_location':
|
||||
@ -525,12 +525,16 @@ class View:
|
||||
elements = {}
|
||||
if data and data.elements:
|
||||
elements = data.elements
|
||||
self.get_current_cfi('show-chrome-' + self.show_chrome_counter, self.do_show_chrome.bind(None, elements))
|
||||
initial_panel = data?.initial_panel or None
|
||||
self.get_current_cfi('show-chrome-' + self.show_chrome_counter, self.do_show_chrome.bind(None, elements, initial_panel))
|
||||
|
||||
def do_show_chrome(self, elements, request_id, cfi_data):
|
||||
def do_show_chrome(self, elements, initial_panel, request_id, cfi_data):
|
||||
self.hide_overlays()
|
||||
self.update_cfi_data(cfi_data)
|
||||
self.overlay.show(elements)
|
||||
if initial_panel:
|
||||
getattr(self.overlay, initial_panel)()
|
||||
else:
|
||||
self.overlay.show(elements)
|
||||
|
||||
def show_search(self):
|
||||
self.hide_overlays()
|
||||
|
Loading…
x
Reference in New Issue
Block a user