Add Preview shortcut for browser

This commit is contained in:
Henrik Giesel 2021-04-15 03:49:53 +02:00
parent 58a85d8386
commit 53ae03becc

View File

@ -396,8 +396,14 @@ $editorToolbar.addButton({{
"""
)
def add_preview_shortcut(cuts, editor: Editor) -> None:
cuts.append(("Ctrl+Shift+P", self.onTogglePreview, True))
gui_hooks.editor_did_init.append(add_preview_button)
gui_hooks.editor_did_init_shortcuts.append(add_preview_shortcut)
self.editor = aqt.editor.Editor(self.mw, self.form.fieldsArea, self)
gui_hooks.editor_did_init_shortcuts.remove(add_preview_shortcut)
gui_hooks.editor_did_init.remove(add_preview_button)
@ensure_editor_saved