From f056851c1e0e45552f85f58e1c6589f88cf366e7 Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Thu, 24 Jun 2021 16:44:08 +0200 Subject: [PATCH] Port Focus tags shortcut to webview --- qt/aqt/editor.py | 4 +--- ts/change-notetype/SaveButton.svelte | 6 +++--- ts/components/Badge.svelte | 2 ++ ts/components/WithShortcut.svelte | 4 ++-- ts/components/helpers.ts | 12 ++++++++++++ ts/deck-options/SaveButton.svelte | 3 ++- ts/editor/AddTagBadge.svelte | 22 ++++++++++++++++------ ts/editor/ClozeButton.svelte | 5 +++-- ts/editor/ColorButtons.svelte | 5 +++-- ts/editor/CommandIconButton.svelte | 5 +++-- ts/editor/NoteTypeButtons.svelte | 3 ++- ts/editor/PreviewButton.svelte | 3 ++- ts/editor/Tag.svelte | 6 +++++- ts/editor/TagInputEdit.svelte | 9 +-------- ts/editor/TemplateButtons.svelte | 21 +++++++++++---------- 15 files changed, 68 insertions(+), 42 deletions(-) diff --git a/qt/aqt/editor.py b/qt/aqt/editor.py index 901cd9736..b15c1aae2 100644 --- a/qt/aqt/editor.py +++ b/qt/aqt/editor.py @@ -300,9 +300,7 @@ $editorToolbar.then(({{ toolbar }}) => toolbar.appendGroup({{ def setupShortcuts(self) -> None: # if a third element is provided, enable shortcut even when no field selected - cuts: List[Tuple] = [ - ("Ctrl+Shift+T", self.onFocusTags, True), - ] + cuts: List[Tuple] = [] gui_hooks.editor_did_init_shortcuts(cuts, self) for row in cuts: if len(row) == 2: diff --git a/ts/change-notetype/SaveButton.svelte b/ts/change-notetype/SaveButton.svelte index c3bd7a8f0..78bb22888 100644 --- a/ts/change-notetype/SaveButton.svelte +++ b/ts/change-notetype/SaveButton.svelte @@ -5,6 +5,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html - (theTagIcon = addTagIcon)} - on:mouseleave={() => (theTagIcon = tagIcon)}>{@html theTagIcon} + + (theTagIcon = addTagIcon)} + on:mouseleave={() => (theTagIcon = tagIcon)} + on:mount={withSpan(createShortcut)}>{@html theTagIcon} +