Viewer: Fix keyboard shortcuts to shrink/grow selection not working. Fixes #1900942 [E-book viewer: the "Alter the current selection" feature doesn't seem to work](https://bugs.launchpad.net/calibre/+bug/1900942)

This commit is contained in:
Kovid Goyal 2020-10-25 11:47:50 +05:30
parent a6737d926d
commit ae222c64f3
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -564,6 +564,7 @@ class SelectionBar:
sc_name = shortcut_for_key_event(ev, self.view.keyboard_shortcut_map) sc_name = shortcut_for_key_event(ev, self.view.keyboard_shortcut_map)
if not sc_name: if not sc_name:
return return
forwarded = {'toggle_highlights': True, 'extend_selection_by_word': True, 'shrink_selection_by_word': True}
if sc_name is 'show_chrome': if sc_name is 'show_chrome':
self.clear_selection() self.clear_selection()
elif sc_name is 'copy_to_clipboard': elif sc_name is 'copy_to_clipboard':
@ -574,7 +575,7 @@ class SelectionBar:
self.book_search() self.book_search()
elif sc_name is 'new_bookmark': elif sc_name is 'new_bookmark':
self.new_bookmark() self.new_bookmark()
elif sc_name is 'toggle_highlights': elif forwarded[sc_name]:
self.view.on_handle_shortcut({'name': sc_name}) self.view.on_handle_shortcut({'name': sc_name})
def report_failed_edit_highlight(self, annot_id): def report_failed_edit_highlight(self, annot_id):