mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Show the highlight and lookup actions if the selection bar is disabled
This commit is contained in:
parent
dd3dad6cb6
commit
83d5865d4c
@ -314,10 +314,13 @@ class MainOverlay: # {{{
|
|||||||
if full_screen_actions.length:
|
if full_screen_actions.length:
|
||||||
actions_div.appendChild(E.ul(*full_screen_actions))
|
actions_div.appendChild(E.ul(*full_screen_actions))
|
||||||
|
|
||||||
|
no_selection_bar = not sd.get('show_selection_bar')
|
||||||
|
if no_selection_bar:
|
||||||
highlight_action = ac(_('Highlight'), _('Highlight text in the book'),
|
highlight_action = ac(_('Highlight'), _('Highlight text in the book'),
|
||||||
def(): self.overlay.hide(), self.overlay.view.initiate_create_annotation();, 'highlight')
|
def(): self.overlay.hide(), self.overlay.view.initiate_create_annotation();, 'highlight')
|
||||||
|
|
||||||
if runtime.is_standalone_viewer:
|
if runtime.is_standalone_viewer:
|
||||||
|
if no_selection_bar:
|
||||||
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(True);, 'library')
|
def(): self.overlay.hide(), ui_operations.toggle_lookup(True);, 'library')
|
||||||
@ -351,6 +354,7 @@ class MainOverlay: # {{{
|
|||||||
def(): self.overlay.hide(), ui_operations.quit();, 'remove'),
|
def(): self.overlay.hide(), ui_operations.quit();, 'remove'),
|
||||||
))
|
))
|
||||||
else:
|
else:
|
||||||
|
if no_selection_bar:
|
||||||
actions_div.appendChild(E.ul(highlight_action))
|
actions_div.appendChild(E.ul(highlight_action))
|
||||||
container.appendChild(set_css(E.div(class_=MAIN_OVERLAY_TS_CLASS, # top section
|
container.appendChild(set_css(E.div(class_=MAIN_OVERLAY_TS_CLASS, # top section
|
||||||
onclick=def (evt):evt.stopPropagation();,
|
onclick=def (evt):evt.stopPropagation();,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user