mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-11 09:13:57 -04:00
Lookup word should work on content server as well
This commit is contained in:
parent
7d00a8cf12
commit
de76fbbda2
@ -44,7 +44,6 @@ class SelectionBar:
|
|||||||
|
|
||||||
if ui_operations.copy_selection:
|
if ui_operations.copy_selection:
|
||||||
bar.appendChild(cb('copy', _('Copy to clipboard'), self.copy_to_clipboard))
|
bar.appendChild(cb('copy', _('Copy to clipboard'), self.copy_to_clipboard))
|
||||||
if ui_operations.toggle_lookup:
|
|
||||||
bar.appendChild(cb('library', _('Lookup/search selected word'), self.lookup))
|
bar.appendChild(cb('library', _('Lookup/search selected word'), self.lookup))
|
||||||
bar.appendChild(cb('highlight', _('Highlight selection'), self.create_highlight))
|
bar.appendChild(cb('highlight', _('Highlight selection'), self.create_highlight))
|
||||||
bar.appendChild(cb('close', _('Clear the selection'), self.clear_selection))
|
bar.appendChild(cb('close', _('Clear the selection'), self.clear_selection))
|
||||||
@ -79,7 +78,10 @@ class SelectionBar:
|
|||||||
ui_operations.copy_selection(self.view.currently_showing.selection.text)
|
ui_operations.copy_selection(self.view.currently_showing.selection.text)
|
||||||
|
|
||||||
def lookup(self):
|
def lookup(self):
|
||||||
|
if ui_operations.toggle_lookup:
|
||||||
ui_operations.toggle_lookup(True)
|
ui_operations.toggle_lookup(True)
|
||||||
|
else:
|
||||||
|
self.view.overlay.show_word_actions(self.view.currently_showing.selection.text)
|
||||||
|
|
||||||
def clear_selection(self):
|
def clear_selection(self):
|
||||||
self.view.on_handle_shortcut({'name': 'clear_selection'})
|
self.view.on_handle_shortcut({'name': 'clear_selection'})
|
||||||
|
@ -250,7 +250,6 @@ class View:
|
|||||||
'handle_keypress': self.on_handle_keypress,
|
'handle_keypress': self.on_handle_keypress,
|
||||||
'handle_shortcut': self.on_handle_shortcut,
|
'handle_shortcut': self.on_handle_shortcut,
|
||||||
'human_scroll': self.on_human_scroll,
|
'human_scroll': self.on_human_scroll,
|
||||||
'lookup_word': self.on_lookup_word,
|
|
||||||
'next_section': self.on_next_section,
|
'next_section': self.on_next_section,
|
||||||
'next_spine_item': self.on_next_spine_item,
|
'next_spine_item': self.on_next_spine_item,
|
||||||
'print': self.on_print,
|
'print': self.on_print,
|
||||||
@ -316,12 +315,6 @@ class View:
|
|||||||
sd = get_session_data()
|
sd = get_session_data()
|
||||||
self.set_scrollbar_visibility(not sd.get('book_scrollbar'))
|
self.set_scrollbar_visibility(not sd.get('book_scrollbar'))
|
||||||
|
|
||||||
def on_lookup_word(self, data):
|
|
||||||
if runtime.is_standalone_viewer:
|
|
||||||
ui_operations.selection_changed(data.word)
|
|
||||||
return
|
|
||||||
self.overlay.show_word_actions(data.word)
|
|
||||||
|
|
||||||
def on_annotations_message(self, data):
|
def on_annotations_message(self, data):
|
||||||
self.create_annotation.handle_message(data)
|
self.create_annotation.handle_message(data)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user