mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
E-book viewer: Add shortcuts shift+home and shift+end to extend current selection to start/end of line
This commit is contained in:
parent
1095dc4dc6
commit
b9dd3758ea
@ -610,6 +610,8 @@ class SelectionBar:
|
||||
'toggle_highlights': True,
|
||||
'edit_book': True,
|
||||
'select_all': True,
|
||||
'extend_selection_to_end_of_line': True,
|
||||
'extend_selection_to_start_of_line': True,
|
||||
}
|
||||
if sc_name is 'show_chrome':
|
||||
self.clear_selection()
|
||||
|
@ -350,6 +350,18 @@ def common_shortcuts(): # {{{
|
||||
_('Alter the current selection forward by a line'),
|
||||
),
|
||||
|
||||
'extend_selection_to_start_of_line': desc(
|
||||
v"['Shift+Home']",
|
||||
'ui',
|
||||
_('Extend current selection to the start of the line'),
|
||||
),
|
||||
|
||||
'extend_selection_to_end_of_line': desc(
|
||||
v"['Shift+End']",
|
||||
'ui',
|
||||
_('Extend current selection to the end of the line'),
|
||||
),
|
||||
|
||||
'select_all': desc(
|
||||
v'["Ctrl+a"]',
|
||||
'ui',
|
||||
|
@ -575,6 +575,10 @@ class View:
|
||||
self.iframe_wrapper.send_message('modify_selection', direction='backward', granularity=data.name.rpartition('_')[-1])
|
||||
elif data.name.startsWith('extend_selection_by_'):
|
||||
self.iframe_wrapper.send_message('modify_selection', direction='forward', granularity=data.name.rpartition('_')[-1])
|
||||
elif data.name is 'extend_selection_to_start_of_line':
|
||||
self.iframe_wrapper.send_message('modify_selection', direction='backward', granularity='lineboundary')
|
||||
elif data.name is 'extend_selection_to_end_of_line':
|
||||
self.iframe_wrapper.send_message('modify_selection', direction='forward', granularity='lineboundary')
|
||||
elif data.name is 'scrollspeed_increase':
|
||||
self.update_scroll_speed(SCROLL_SPEED_STEP)
|
||||
elif data.name is 'scrollspeed_decrease':
|
||||
|
Loading…
x
Reference in New Issue
Block a user