fixed dropdown_menu_fallback.py for macOS

This commit is contained in:
Tom Schimansky 2022-06-15 00:14:35 +02:00
parent 413cedd093
commit a86dbd4d07
2 changed files with 6 additions and 2 deletions

View File

@ -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),

View File

@ -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")