diff --git a/src/calibre/gui2/viewer/keys.py b/src/calibre/gui2/viewer/keys.py index 02a3646c51..f5d60af260 100644 --- a/src/calibre/gui2/viewer/keys.py +++ b/src/calibre/gui2/viewer/keys.py @@ -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')), diff --git a/src/calibre/gui2/viewer/main.py b/src/calibre/gui2/viewer/main.py index d636eff0c6..c5f28ddcab 100644 --- a/src/calibre/gui2/viewer/main.py +++ b/src/calibre/gui2/viewer/main.py @@ -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() diff --git a/src/calibre/gui2/viewer/ui.py b/src/calibre/gui2/viewer/ui.py index 2c82de61c4..704a1f7b70 100644 --- a/src/calibre/gui2/viewer/ui.py +++ b/src/calibre/gui2/viewer/ui.py @@ -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()