From a86dbd4d07692a29d9d89fdf69a91d04d840affc Mon Sep 17 00:00:00 2001 From: Tom Schimansky Date: Wed, 15 Jun 2022 00:14:35 +0200 Subject: [PATCH] fixed dropdown_menu_fallback.py for macOS --- customtkinter/widgets/dropdown_menu_fallback.py | 6 +++++- examples/simple_example.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/customtkinter/widgets/dropdown_menu_fallback.py b/customtkinter/widgets/dropdown_menu_fallback.py index da01572..cf5317d 100644 --- a/customtkinter/widgets/dropdown_menu_fallback.py +++ b/customtkinter/widgets/dropdown_menu_fallback.py @@ -35,7 +35,11 @@ class DropdownMenuFallback(tkinter.Menu): self.text_color = ThemeManager.theme["color"]["text"] if text_color == "default_theme" else text_color self.text_font = (ThemeManager.theme["text"]["font"], ThemeManager.theme["text"]["size"]) if text_font == "default_theme" else text_font - if sys.platform.startswith("win"): + if sys.platform == "darwin": + self.configure(tearoff=False, + font=self.apply_font_scaling(self.text_font)) + + elif sys.platform.startswith("win"): self.configure(tearoff=False, relief="flat", activebackground=ThemeManager.single_color(self.button_hover_color, self._appearance_mode), diff --git a/examples/simple_example.py b/examples/simple_example.py index e0bdf80..57b13d8 100644 --- a/examples/simple_example.py +++ b/examples/simple_example.py @@ -36,7 +36,7 @@ slider_1.set(0.5) entry_1 = customtkinter.CTkEntry(master=frame_1, placeholder_text="CTkEntry") entry_1.pack(pady=12, padx=10) -optionmenu_1 = customtkinter.CTkOptionMenu(frame_1, values=["Option 1", "Option 2", "Option 42"]) +optionmenu_1 = customtkinter.CTkOptionMenu(frame_1, values=["Option 1", "Option 2", "Option 42 long long long..."]) optionmenu_1.pack(pady=12, padx=10) optionmenu_1.set("CTkOptionMenu")