From 3b259e4d01fb10e75256173ffe58d80ce40b91f3 Mon Sep 17 00:00:00 2001 From: tschiman Date: Thu, 16 Jun 2022 16:55:17 +0200 Subject: [PATCH] refined dropdown word spacing for linux --- customtkinter/widgets/dropdown_menu.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/customtkinter/widgets/dropdown_menu.py b/customtkinter/widgets/dropdown_menu.py index fad3193..4c0fde6 100644 --- a/customtkinter/widgets/dropdown_menu.py +++ b/customtkinter/widgets/dropdown_menu.py @@ -70,10 +70,16 @@ class DropdownMenu(tkinter.Menu): font=self.apply_font_scaling(self.text_font)) def add_menu_commands(self): - for value in self.values: - self.add_command(label=value.ljust(self.min_character_width), - command=lambda v=value: self.button_callback(v), - compound="left") + if sys.platform.startswith("linux"): + for value in self.values: + self.add_command(label=" " + value.ljust(self.min_character_width) + " ", + command=lambda v=value: self.button_callback(v), + compound="left") + else: + for value in self.values: + self.add_command(label=value.ljust(self.min_character_width), + command=lambda v=value: self.button_callback(v), + compound="left") def open(self, x: Union[int, float], y: Union[int, float]): if sys.platform == "darwin":