E-book viewer: Add a keyboard shortcut to toggle the Table of Contents [Ctrl+T]

This commit is contained in:
Kovid Goyal 2014-10-05 23:01:15 +05:30
parent 838665304d
commit 00ccf29b50
3 changed files with 5 additions and 1 deletions

View File

@ -78,6 +78,9 @@ SHORTCUTS = {
'Search online': (['Ctrl+E'],
_('Search online for word')),
'Table of Contents': (['Ctrl+T'],
_('Show/hide the Table of Contents')),
'Lookup word': (['Ctrl+L'],
_('Lookup word in dictionary')),

View File

@ -933,6 +933,7 @@ class EbookViewer(MainWindow):
'Next occurrence': self.view.search_action,
'Bookmark': bac,
'Reload': self.action_reload,
'Table of Contents': self.action_table_of_contents,
}.get(key, None)
if action is not None:
event.accept()

View File

@ -348,7 +348,7 @@ class Main(MainWindow):
a('copy', _('Copy to clipboard'), 'edit-copy.png').setDisabled(True)
a('font_size_larger', _('Increase font size'), 'font_size_larger.png')
a('font_size_smaller', _('Decrease font size'), 'font_size_smaller.png')
a('table_of_contents', self.toc_dock, 'highlight_only_on.png')
a('table_of_contents', self.toc_dock, 'highlight_only_on.png', sc_name='Table of Contents')
a('full_screen', _('Toggle full screen'), 'page.png', sc_name='Fullscreen').setCheckable(True)
self.tool_bar.addSeparator()