E-book viewer: Fix clicking on ToC entries moving keyboard focus to the ToC search box when the ToC window is floating

This commit is contained in:
Kovid Goyal 2022-07-26 12:24:08 +05:30
parent f7b592023f
commit 5d4fcb02df
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -362,6 +362,11 @@ class EbookViewer(MainWindow):
def toc_clicked(self, index):
item = self.toc_model.itemFromIndex(index)
self.web_view.goto_toc_node(item.node_id)
self.force_focus_on_web_view()
def force_focus_on_web_view(self):
self.activateWindow()
self.web_view.setFocus(Qt.FocusReason.OtherFocusReason)
def toc_searched(self, index):
item = self.toc_model.itemFromIndex(index)