E-book viewer: Fix back button not working after jumping to a bookmark. Fixes #1931599 [[Enhancement] E-book viewer: clicking on bookmarks should create jump positions](https://bugs.launchpad.net/calibre/+bug/1931599)

This commit is contained in:
Kovid Goyal 2021-06-22 08:53:08 +05:30
parent f77a5f5c1a
commit 83ede77029
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
4 changed files with 8 additions and 8 deletions

View File

@ -366,11 +366,11 @@ class EbookViewer(MainWindow):
# annotations will be saved in book file on exit
self.save_annotations(in_book_file=False)
def goto_cfi(self, cfi):
self.web_view.goto_cfi(cfi)
def goto_cfi(self, cfi, add_to_history=False):
self.web_view.goto_cfi(cfi, add_to_history=add_to_history)
def bookmark_activated(self, cfi):
self.goto_cfi(cfi)
self.goto_cfi(cfi, add_to_history=True)
def view_image(self, name):
path = get_path_for_name(name)

View File

@ -649,8 +649,8 @@ class WebView(RestartingWebEngineView):
def goto_toc_node(self, node_id):
self.execute_when_ready('goto_toc_node', node_id)
def goto_cfi(self, cfi):
self.execute_when_ready('goto_cfi', cfi)
def goto_cfi(self, cfi, add_to_history=False):
self.execute_when_ready('goto_cfi', cfi, bool(add_to_history))
def notify_full_screen_state_change(self, in_fullscreen_mode):
self.execute_when_ready('full_screen_state_changed', in_fullscreen_mode)

View File

@ -12,7 +12,7 @@ from widgets import create_button
def goto_cfi(cfi, view):
view.goto_cfi(cfi)
view.goto_cfi(cfi, True)
def remove_bookmark(annotations_manager, title, list_dom_node):

View File

@ -234,8 +234,8 @@ def goto_toc_node(node_id):
@from_python
def goto_cfi(cfi):
view.goto_cfi(cfi)
def goto_cfi(cfi, add_to_history):
view.goto_cfi(cfi, v'!!add_to_history')
@from_python