mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-24 06:16:38 +01:00
Show the highlight and lookup actions if the selection bar is disabled
This commit is contained in:
parent
dd3dad6cb6
commit
83d5865d4c
1 changed files with 12 additions and 8 deletions
|
|
@ -314,15 +314,18 @@ def ac(text, tooltip, action, icon, is_text_button):
|
|||
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')
|
||||
no_selection_bar = not sd.get('show_selection_bar')
|
||||
if no_selection_bar:
|
||||
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)
|
||||
if no_selection_bar:
|
||||
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')
|
||||
|
|
@ -351,7 +354,8 @@ def ac(text, tooltip, action, icon, is_text_button):
|
|||
def(): self.overlay.hide(), ui_operations.quit();, 'remove'),
|
||||
))
|
||||
else:
|
||||
actions_div.appendChild(E.ul(highlight_action))
|
||||
if no_selection_bar:
|
||||
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();,
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue