mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-29 16:46:21 +01: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
3 changed files with 18 additions and 0 deletions
|
|
@ -610,6 +610,8 @@ def on_keydown(self, ev):
|
|||
'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 @@ def on_handle_shortcut(self, data):
|
|||
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…
Reference in a new issue