Fix an issue with Language and Priority mode comboboxes cutting off text in translations

This commit is contained in:
DevilXD
2025-10-09 17:44:34 +02:00
parent 7b95818add
commit bbc323b4d7

5
gui.py
View File

@@ -403,7 +403,10 @@ class SelectCombobox(ttk.Combobox):
**kwargs,
) -> None:
if width is None:
width = max(len(v) for v in values)
font = Font(master, ttk.Style().lookup("TCombobox", "font"))
# font.measure returns width in pixels, using '0' as the average character,
# which is 6 pixels wide. We can convert it to width in characters by dividing.
width = max(font.measure(v) // 6 + 1 for v in values)
width += width_offset
super().__init__(
master,