Skip to content

Commit

Permalink
fix: Bolding textblock crashes due to font_formatting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kagenihisomi committed Jan 30, 2024
1 parent cf7e88f commit 8640526
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ui/fontformat_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,15 @@ def ffmt_change_weight(param_name: str, values: str, act_ffmt: FontFormat, is_gl
for blkitem, value in zip(blkitems, values):
blkitem.setFontWeight(value, **set_kwargs)

@font_formating()
def ffmt_change_bold(param_name: str, values: str, act_ffmt: FontFormat, is_global: bool, blkitems: List[TextBlkItem] = None, **kwargs):
if not isinstance(blkitems, List):
blkitems = [blkitems]
if not isinstance(values, List):
values = [values] * len(blkitems)
else:
# Currently passed as single value list [True]/[False]
values = values * len(blkitems)
values = [QFont.Bold if value else QFont.Normal for value in values]
ffmt_change_weight('weight', values, act_ffmt, is_global, blkitems, **kwargs)

Expand Down

0 comments on commit 8640526

Please sign in to comment.