mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Viewer toolbar: Add an action to toggle the inspector
This commit is contained in:
parent
4b077904c0
commit
6ca7282fd9
@ -50,6 +50,7 @@ def all_actions():
|
|||||||
'previous': Action('previous.png', _('Previous page'), 'previous'),
|
'previous': Action('previous.png', _('Previous page'), 'previous'),
|
||||||
'toc': Action('toc.png', _('Table of Contents'), 'toggle_toc'),
|
'toc': Action('toc.png', _('Table of Contents'), 'toggle_toc'),
|
||||||
'bookmarks': Action('bookmarks.png', _('Bookmarks'), 'toggle_bookmarks'),
|
'bookmarks': Action('bookmarks.png', _('Bookmarks'), 'toggle_bookmarks'),
|
||||||
|
'inspector': Action('debug.png', _('Inspector'), 'toggle_inspector'),
|
||||||
'reference': Action('reference.png', _('Toggle Reference mode'), 'toggle_reference_mode'),
|
'reference': Action('reference.png', _('Toggle Reference mode'), 'toggle_reference_mode'),
|
||||||
'lookup': Action('generic-library.png', _('Lookup words'), 'toggle_lookup'),
|
'lookup': Action('generic-library.png', _('Lookup words'), 'toggle_lookup'),
|
||||||
'chrome': Action('tweaks.png', _('Show viewer controls'), 'show_chrome'),
|
'chrome': Action('tweaks.png', _('Show viewer controls'), 'show_chrome'),
|
||||||
@ -64,7 +65,7 @@ def all_actions():
|
|||||||
DEFAULT_ACTIONS = (
|
DEFAULT_ACTIONS = (
|
||||||
'back', 'forward', None, 'open', 'copy', 'increase_font_size', 'decrease_font_size', 'fullscreen',
|
'back', 'forward', None, 'open', 'copy', 'increase_font_size', 'decrease_font_size', 'fullscreen',
|
||||||
None, 'previous', 'next', None, 'toc', 'bookmarks', 'lookup', 'reference', 'chrome', None, 'mode', 'print', 'preferences',
|
None, 'previous', 'next', None, 'toc', 'bookmarks', 'lookup', 'reference', 'chrome', None, 'mode', 'print', 'preferences',
|
||||||
'metadata'
|
'metadata', 'inspector'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -155,6 +156,8 @@ class ActionsToolBar(ToolBar):
|
|||||||
a.setCheckable(True)
|
a.setCheckable(True)
|
||||||
self.lookup_action = a = shortcut_action('lookup')
|
self.lookup_action = a = shortcut_action('lookup')
|
||||||
a.setCheckable(True)
|
a.setCheckable(True)
|
||||||
|
self.inspector_action = a = shortcut_action('inspector')
|
||||||
|
a.setCheckable(True)
|
||||||
self.chrome_action = shortcut_action('chrome')
|
self.chrome_action = shortcut_action('chrome')
|
||||||
|
|
||||||
self.mode_action = a = shortcut_action('mode')
|
self.mode_action = a = shortcut_action('mode')
|
||||||
@ -191,7 +194,7 @@ class ActionsToolBar(ToolBar):
|
|||||||
self.reference_action.setChecked(enabled)
|
self.reference_action.setChecked(enabled)
|
||||||
|
|
||||||
def update_dock_actions(self, visibility_map):
|
def update_dock_actions(self, visibility_map):
|
||||||
for k in ('toc', 'bookmarks', 'lookup'):
|
for k in ('toc', 'bookmarks', 'lookup', 'inspector'):
|
||||||
ac = getattr(self, '{}_action'.format(k))
|
ac = getattr(self, '{}_action'.format(k))
|
||||||
ac.setChecked(visibility_map[k])
|
ac.setChecked(visibility_map[k])
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user