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

This commit is contained in:
DevilXD committed 2025-10-09 17:44:34 +02:00
1 parent 7b95818add
commit bbc323b4d7
1 file changed
+4 -1
+4 -1
View File
@@ -403,7 +403,10 @@ class SelectCombobox(ttk.Combobox):
**kwargs, **kwargs,
) -> None: ) -> None:
if width is 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 width += width_offset
super().__init__( super().__init__(
master, master,