From 6d6c798ca31df6e4ca6c07831783ab5e99897c2d Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Tue, 27 Apr 2021 17:20:13 +0200 Subject: [PATCH 01/39] Simplify structure of EditorToolbar and ButtonGroup in editor HTML file --- qt/aqt/editor.py | 18 ++------- ts/editor-toolbar/ButtonDropdown.svelte | 4 +- ts/editor-toolbar/ButtonGroup.svelte | 54 ++++++++++--------------- ts/editor-toolbar/DropdownMenu.svelte | 14 +------ ts/editor-toolbar/EditorToolbar.svelte | 6 +-- ts/editor-toolbar/index.ts | 19 ++++++--- ts/editor/fields.scss | 6 +-- ts/editor/toolbar.ts | 5 ++- ts/sass/base.scss | 9 +++++ 9 files changed, 58 insertions(+), 77 deletions(-) diff --git a/qt/aqt/editor.py b/qt/aqt/editor.py index 5065abb29..338868cf2 100644 --- a/qt/aqt/editor.py +++ b/qt/aqt/editor.py @@ -76,18 +76,9 @@ audio = ( ) _html = """ - -
-
-
-
-
- %s -
+
+
+ %s
""" @@ -135,10 +126,9 @@ class Editor: self.web.set_bridge_command(self.onBridgeCmd, self) self.outerLayout.addWidget(self.web, 1) - bgcol = self.mw.app.palette().window().color().name() # type: ignore # then load page self.web.stdHtml( - _html % (bgcol, tr.editing_show_duplicates()), + _html % tr.editing_show_duplicates(), css=[ "css/editor.css", ], diff --git a/ts/editor-toolbar/ButtonDropdown.svelte b/ts/editor-toolbar/ButtonDropdown.svelte index a1585c12f..65e778e6a 100644 --- a/ts/editor-toolbar/ButtonDropdown.svelte +++ b/ts/editor-toolbar/ButtonDropdown.svelte @@ -17,13 +17,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html diff --git a/ts/editor-toolbar/ButtonGroup.svelte b/ts/editor-toolbar/ButtonGroup.svelte index ad2101a19..a23c5f5c2 100644 --- a/ts/editor-toolbar/ButtonGroup.svelte +++ b/ts/editor-toolbar/ButtonGroup.svelte @@ -19,16 +19,30 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html - +
diff --git a/ts/editor-toolbar/DropdownMenu.svelte b/ts/editor-toolbar/DropdownMenu.svelte index f616dd0a5..707ac07ad 100644 --- a/ts/editor-toolbar/DropdownMenu.svelte +++ b/ts/editor-toolbar/DropdownMenu.svelte @@ -4,29 +4,19 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html --> -