Add shortcuts to change font size

This commit is contained in:
Kovid Goyal 2019-08-26 09:18:02 +05:30
parent 3d4dae9d08
commit ece5180a80
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 16 additions and 0 deletions

View File

@ -81,4 +81,5 @@ ui_operations = {
'goto_bookpos': None,
'delete_book': None,
'focus_iframe': None,
'toggle_toc': None,
}

View File

@ -175,6 +175,17 @@ SHORTCUTS = {
_('Find previous'),
),
'increase_font_size': desc(
v"['Ctrl+=', 'Ctrl++', 'Ctrl+Shift++', 'Ctrl+Shift+=']",
'ui',
_('Increase font size'),
),
'decrease_font_size': desc(
v"['Ctrl+-', 'Ctrl+_', 'Ctrl+Shift+-', 'Ctrl+Shift+_']",
'ui',
_('Decrease font size'),
),
}

View File

@ -237,6 +237,10 @@ class View:
self.search_overlay.find_next()
elif data.name is 'previous_match':
self.search_overlay.find_previous()
elif data.name is 'increase_font_size':
self.bump_font_size({'increase': True})
elif data.name is 'decrease_font_size':
self.bump_font_size({'increase': False})
def on_selection_change(self, data):
self.currently_showing.selected_text = data.text