The chrome lookup word control is not a toggle

This commit is contained in:
Kovid Goyal 2020-07-22 15:26:53 +05:30
parent bda006557a
commit 626b2209d6
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 5 additions and 5 deletions

View File

@ -333,8 +333,8 @@ class EbookViewer(MainWindow):
else: else:
self.highlights_widget.focus() self.highlights_widget.focus()
def toggle_lookup(self): def toggle_lookup(self, force_show=False):
self.lookup_dock.setVisible(not self.lookup_dock.isVisible()) self.lookup_dock.setVisible(force_show or not self.lookup_dock.isVisible())
def toc_clicked(self, index): def toc_clicked(self, index):
item = self.toc_model.itemFromIndex(index) item = self.toc_model.itemFromIndex(index)

View File

@ -240,7 +240,7 @@ class ViewerBridge(Bridge):
toggle_highlights = from_js() toggle_highlights = from_js()
new_bookmark = from_js() new_bookmark = from_js()
toggle_inspector = from_js() toggle_inspector = from_js()
toggle_lookup = from_js() toggle_lookup = from_js(object)
show_search = from_js() show_search = from_js()
search_result_not_found = from_js(object) search_result_not_found = from_js(object)
find_next = from_js(object) find_next = from_js(object)
@ -437,7 +437,7 @@ class WebView(RestartingWebEngineView):
toggle_highlights = pyqtSignal() toggle_highlights = pyqtSignal()
new_bookmark = pyqtSignal() new_bookmark = pyqtSignal()
toggle_inspector = pyqtSignal() toggle_inspector = pyqtSignal()
toggle_lookup = pyqtSignal() toggle_lookup = pyqtSignal(object)
quit = pyqtSignal() quit = pyqtSignal()
update_current_toc_nodes = pyqtSignal(object, object) update_current_toc_nodes = pyqtSignal(object, object)
toggle_full_screen = pyqtSignal() toggle_full_screen = pyqtSignal()

View File

@ -320,7 +320,7 @@ class MainOverlay: # {{{
if runtime.is_standalone_viewer: if runtime.is_standalone_viewer:
actions_div.appendChild(E.ul( actions_div.appendChild(E.ul(
ac(_('Lookup/search word'), _('Lookup or search for the currently selected word'), ac(_('Lookup/search word'), _('Lookup or search for the currently selected word'),
def(): self.overlay.hide(), ui_operations.toggle_lookup();, 'library') def(): self.overlay.hide(), ui_operations.toggle_lookup(True);, 'library')
)) ))
actions_div.lastChild.appendChild(highlight_action) actions_div.lastChild.appendChild(highlight_action)
actions_div.lastChild.appendChild( actions_div.lastChild.appendChild(