Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify the format string #3293

Merged
merged 2 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ RRomeroJr <[email protected]>
Xidorn Quan <[email protected]>
Alexander Bocken <[email protected]>
James Elmore <[email protected]>
David Culley <[email protected]>
Rastislav Kish <[email protected]>

********************
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