From 592dad1194a3ba50d46e29360c4e9c5709a73610 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 20 Feb 2024 21:48:28 +0530 Subject: [PATCH] Keyboard shortcut to show profiles --- manual/viewer.rst | 2 ++ src/pyj/read_book/shortcuts.pyj | 6 ++++++ src/pyj/read_book/view.pyj | 2 ++ 3 files changed, 10 insertions(+) diff --git a/manual/viewer.rst b/manual/viewer.rst index c9a57fc177..901117dd80 100644 --- a/manual/viewer.rst +++ b/manual/viewer.rst @@ -301,6 +301,8 @@ be customised in the viewer :guilabel:`Preferences`. The default shortcuts are l - Toggle Table of Contents * - :kbd:`Ctrl+S` - Read aloud + * - :kbd:`Alt+P` + - Change settings quickly by creating and switching to :guilabel:`profiles` * - :kbd:`Alt+f` - Follow links with the keyboard * - :kbd:`Ctrl+C` diff --git a/src/pyj/read_book/shortcuts.pyj b/src/pyj/read_book/shortcuts.pyj index 24fcf1ce34..4e426b1ff6 100644 --- a/src/pyj/read_book/shortcuts.pyj +++ b/src/pyj/read_book/shortcuts.pyj @@ -314,6 +314,12 @@ def common_shortcuts(): # {{{ _('Show the book metadata') ), + 'show_profiles': desc( + v"['Alt+p']", + 'ui', + _('Change settings quickly by creating and switching to "profiles"') + ), + 'reload_book': desc( v"['Ctrl+Alt+F5', 'Ctrl+Alt+r']", 'ui', diff --git a/src/pyj/read_book/view.pyj b/src/pyj/read_book/view.pyj index 4dc0e7a66f..5874651cd1 100644 --- a/src/pyj/read_book/view.pyj +++ b/src/pyj/read_book/view.pyj @@ -493,6 +493,8 @@ class View: ui_operations.toggle_bookmarks() else: self.overlay.show_bookmarks() + elif data.name is 'show_profiles': + self.overlay.show_profiles() elif data.name is 'toggle_highlights': ui_operations.toggle_highlights() elif data.name is 'new_bookmark':