Wrap settings titles.

This commit is contained in:
Dan Albert 2023-05-13 16:50:45 -07:00
parent e0edfa68b1
commit 97c4168d13

View File

@ -112,7 +112,8 @@ class AutoSettingsLayout(QGridLayout):
raise TypeError(f"Unhandled option type: {description}")
def add_label(self, row: int, description: OptionDescription) -> None:
text = f"<strong>{description.text}</strong>"
wrapped_title = "<br />".join(textwrap.wrap(description.text, width=55))
text = f"<strong>{wrapped_title}</strong>"
if description.detail is not None:
wrapped = "<br />".join(textwrap.wrap(description.detail, width=55))
text += f"<br />{wrapped}"