From e9ca17b1b3a032be704b2df0db1a66c014e345ac Mon Sep 17 00:00:00 2001 From: Henrik Giesel Date: Sun, 4 Oct 2020 23:03:37 +0200 Subject: [PATCH] Turn _class into rightside boolean flag --- qt/aqt/editor.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/qt/aqt/editor.py b/qt/aqt/editor.py index e315c5fd3..3ae5ef093 100644 --- a/qt/aqt/editor.py +++ b/qt/aqt/editor.py @@ -124,16 +124,16 @@ class Editor: "fields", _("Customize Fields"), _("Fields") + "...", - class_="", disables=False, + rightside=False, ), self._addButton( None, "cards", _("Customize Card Templates (Ctrl+L)"), _("Cards") + "...", - class_="", disables=False, + rightside=False, ), ] @@ -227,7 +227,7 @@ class Editor: toggleable: bool = False, keys: str = None, disables: bool = True, - class_: str = "linkb", + rightside: bool = True, ): """Assign func to bridge cmd, register shortcut, return button""" if func: @@ -246,7 +246,7 @@ class Editor: id=id, toggleable=toggleable, disables=disables, - class_=class_, + rightside=rightside, ) return btn @@ -259,7 +259,7 @@ class Editor: id: Optional[str] = None, toggleable: bool = False, disables: bool = True, - class_: str = "linkb", + rightside: bool = True, ) -> str: if icon: if icon.startswith("qrc:/"): @@ -284,6 +284,10 @@ class Editor: else: toggleScript = "" tip = shortcut(tip) + if rightside: + class_ = "linkb" + else: + class_ = "" if not disables: class_ += " perm" return """