From cc5ba4ed840baa50136ee172a76a30546175d373 Mon Sep 17 00:00:00 2001 From: Matthias Metelka <62722460+kleinerpirat@users.noreply.github.com> Date: Mon, 13 Dec 2021 05:06:12 +0100 Subject: [PATCH] Reimplement "Show Duplicates" button in editor (#1550) * Add "Show duplicates" to LabelContainer * Avoid bubbling down the duplicate logic into EditorField * Move duplicate link into its own slot to center it between name/description and field-state. * Revert "Move duplicate link into its own slot" This reverts commit 3a4511042da7083a52d67b58550b13d873dcbea5. * Justify dupes within FieldState to achieve the same result as before while avoiding additional logic within EditorField. Co-Authored-By: Henrik Giesel --- qt/aqt/editor.py | 2 +- ts/editor/DuplicateLink.svelte | 25 +++++++++++++++++++++++++ ts/editor/FieldState.svelte | 4 +++- ts/editor/OldEditorAdapter.svelte | 4 ++++ 4 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 ts/editor/DuplicateLink.svelte diff --git a/qt/aqt/editor.py b/qt/aqt/editor.py index d01bfe9f9..829e9d50e 100644 --- a/qt/aqt/editor.py +++ b/qt/aqt/editor.py @@ -127,7 +127,7 @@ class Editor: # then load page self.web.stdHtml( - "", # % tr.editing_show_duplicates(), + "", css=["css/editor.css"], js=["js/editor.js"], context=self, diff --git a/ts/editor/DuplicateLink.svelte b/ts/editor/DuplicateLink.svelte new file mode 100644 index 000000000..5f3a73cd9 --- /dev/null +++ b/ts/editor/DuplicateLink.svelte @@ -0,0 +1,25 @@ + + + + bridgeCommand("dupes")} +> + {tr.editingShowDuplicates()} + + + diff --git a/ts/editor/FieldState.svelte b/ts/editor/FieldState.svelte index 22898bf26..f41ed793a 100644 --- a/ts/editor/FieldState.svelte +++ b/ts/editor/FieldState.svelte @@ -2,13 +2,15 @@ Copyright: Ankitects Pty Ltd and contributors License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html --> - +