Skip to content

Commit

Permalink
Simplify the format string (#3293)
Browse files Browse the repository at this point in the history
* refactor: simplify format string

* chore: add myself to CONTRIBUTORS file
  • Loading branch information
davidculley authored Jul 10, 2024
1 parent 56a085b commit 9d8782c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ RRomeroJr <117.rromero@gmail.com>
Xidorn Quan <me@upsuper.org>
Alexander Bocken <alexander@bocken.org>
James Elmore <email@jameselmore.org>
David Culley <6276049+davidculley@users.noreply.github.com>
Rastislav Kish <rastislav.kish@protonmail.com>

********************
Expand Down
16 changes: 4 additions & 12 deletions qt/aqt/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,25 +323,17 @@ def _addButton(
class_ = "rounded"
if not disables:
class_ += " perm"
return """<button tabindex=-1
{id}
return f"""<button tabindex=-1
{idstr}
class="{class_}"
type="button"
title="{tip}"
onclick="pycmd('{cmd}');{togglesc}return false;"
onclick="pycmd('{cmd}');{toggleScript}return false;"
onmousedown="window.event.preventDefault();"
>
{imgelm}
{labelelm}
</button>""".format(
imgelm=imgelm,
cmd=cmd,
tip=tip,
labelelm=labelelm,
id=idstr,
togglesc=toggleScript,
class_=class_,
)
</button>"""

def setupShortcuts(self) -> None:
# if a third element is provided, enable shortcut even when no field selected
Expand Down

0 comments on commit 9d8782c

Please sign in to comment.