From dd3dad6cb631e8cdd7b482fb5ebddacead970466 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 27 Jul 2020 19:29:36 +0530 Subject: [PATCH] Revert "Remove lookup and highlight actions from chrome" This reverts commit c7d9ae13e2b05167c82485934112f128466fe826. --- src/pyj/read_book/overlay.pyj | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/pyj/read_book/overlay.pyj b/src/pyj/read_book/overlay.pyj index ff46f33cdc..6d59e2cd61 100644 --- a/src/pyj/read_book/overlay.pyj +++ b/src/pyj/read_book/overlay.pyj @@ -314,7 +314,15 @@ class MainOverlay: # {{{ if full_screen_actions.length: actions_div.appendChild(E.ul(*full_screen_actions)) + highlight_action = ac(_('Highlight'), _('Highlight text in the book'), + def(): self.overlay.hide(), self.overlay.view.initiate_create_annotation();, 'highlight') + if runtime.is_standalone_viewer: + actions_div.appendChild(E.ul( + ac(_('Lookup/search word'), _('Lookup or search for the currently selected word'), + def(): self.overlay.hide(), ui_operations.toggle_lookup(True);, 'library') + )) + actions_div.lastChild.appendChild(highlight_action) actions_div.lastChild.appendChild( ac(_('Browse highlights'), _('Browse all highlights'), def(): self.overlay.hide(), ui_operations.toggle_highlights();, 'image') @@ -342,6 +350,8 @@ class MainOverlay: # {{{ ac(_('Quit'), _('Close the viewer'), def(): self.overlay.hide(), ui_operations.quit();, 'remove'), )) + else: + actions_div.appendChild(E.ul(highlight_action)) container.appendChild(set_css(E.div(class_=MAIN_OVERLAY_TS_CLASS, # top section onclick=def (evt):evt.stopPropagation();,