diff --git a/Readme.md b/Readme.md index 7fc5931..d27cba6 100644 --- a/Readme.md +++ b/Readme.md @@ -85,11 +85,7 @@ root_tk = customtkinter.CTk() ... the program ... root_tk.mainloop() - ``` -The above results in a window with a black title-bar with macOS dark-mode turned on: - -![](documentation_images/simple_macOS_darkmode_test.png) If you set the appearance mode to "System", it should change with the System mode: @@ -114,6 +110,20 @@ colors and removed the round corners, and added a border to the buttons: ![](documentation_images/complex_example_other_style.png) +### Default color themes + +If you don't set any colors at all you will get the standard blue +color theme.But you can also change the standard color theme to +green or dark-blue with the following command before you create +the main window: +```python +customtkinter.set_appearance_mode("System") +customtkinter.set_default_color_theme("dark-blue") # Themes: "blue" (standard), "green", "dark-blue" +``` +The color themes look like the following in light and dark mode: + +![](documentation_images/themes.jpg) + ### CustomTkinter on Windows/Linux All elements of Customtkinter are drawn on the ```tkinter.Canvas```. @@ -458,6 +468,11 @@ customtkinter.set_appearance_mode("System") print(customtkinter.get_appearance_mode()) ``` +Set default color theme: +```python +customtkinter.set_default_color_theme("dark-blue") # Themes: "blue" (standard), "green", "dark-blue" +``` + Use macOS darkmode window style without using the `customtkinter.Ctk` class: ```python customtkinter.enable_macos_darkmode() # get darkmode window style diff --git a/customtkinter/customtkinter_button.py b/customtkinter/customtkinter_button.py index 0abdfcd..0ff4cb2 100644 --- a/customtkinter/customtkinter_button.py +++ b/customtkinter/customtkinter_button.py @@ -572,4 +572,3 @@ class CTkButton(tkinter.Frame): self.bg_color = self.master.cget("bg") self.draw() - self.update_idletasks() \ No newline at end of file diff --git a/customtkinter/customtkinter_checkbox.py b/customtkinter/customtkinter_checkbox.py index 0a2ebbb..7d441f3 100644 --- a/customtkinter/customtkinter_checkbox.py +++ b/customtkinter/customtkinter_checkbox.py @@ -403,4 +403,3 @@ class CTkCheckBox(tkinter.Frame): self.bg_color = self.master.cget("bg") self.draw() - self.update_idletasks() diff --git a/customtkinter/customtkinter_color_manager.py b/customtkinter/customtkinter_color_manager.py index 7147a03..26a078f 100644 --- a/customtkinter/customtkinter_color_manager.py +++ b/customtkinter/customtkinter_color_manager.py @@ -40,7 +40,7 @@ class CTkColorManager: cls.WINDOW_BG = ("#ECECEC", "#323232") # macOS standard light and dark window bg colors cls.MAIN = ("#29B57E", "#29B57E") cls.MAIN_HOVER = ("#6ACBA5", "#6ACBA5") - cls.ENTRY = ("#656565", "#222223") + cls.ENTRY = ("gray60", "#222223") cls.TEXT = ("black", "white") cls.LABEL_BG = ("white", "#626061") cls.SLIDER_BG = ("#636363", "#0D1321") diff --git a/customtkinter/customtkinter_entry.py b/customtkinter/customtkinter_entry.py index b8127d1..b99344b 100644 --- a/customtkinter/customtkinter_entry.py +++ b/customtkinter/customtkinter_entry.py @@ -210,5 +210,3 @@ class CTkEntry(tkinter.Frame): self.bg_color = self.master.cget("bg") self.draw() - self.update_idletasks() - diff --git a/customtkinter/customtkinter_label.py b/customtkinter/customtkinter_label.py index c3f0131..9fa3d92 100644 --- a/customtkinter/customtkinter_label.py +++ b/customtkinter/customtkinter_label.py @@ -223,4 +223,3 @@ class CTkLabel(tkinter.Frame): self.bg_color = self.master.cget("bg") self.draw() - self.update_idletasks() diff --git a/customtkinter/customtkinter_progressbar.py b/customtkinter/customtkinter_progressbar.py index 8e922ec..432caa2 100644 --- a/customtkinter/customtkinter_progressbar.py +++ b/customtkinter/customtkinter_progressbar.py @@ -279,4 +279,3 @@ class CTkProgressBar(tkinter.Frame): self.bg_color = self.master.cget("bg") self.draw() - self.update_idletasks() diff --git a/customtkinter/customtkinter_slider.py b/customtkinter/customtkinter_slider.py index 878d89f..9ffa20d 100644 --- a/customtkinter/customtkinter_slider.py +++ b/customtkinter/customtkinter_slider.py @@ -405,4 +405,3 @@ class CTkSlider(tkinter.Frame): self.bg_color = self.master.cget("bg") self.draw() - self.update_idletasks() diff --git a/customtkinter/customtkinter_tk.py b/customtkinter/customtkinter_tk.py index 1ed957a..f5f6f6f 100644 --- a/customtkinter/customtkinter_tk.py +++ b/customtkinter/customtkinter_tk.py @@ -75,7 +75,6 @@ class CTk(tkinter.Tk): from .customtkinter_button import CTkButton for child in self.winfo_children(): - print("tk change children:", child) if isinstance(child, (CTkFrame, CTkButton, CTkLabel, CTkSlider, CTkCheckBox, CTkEntry, CTkProgressBar)): child.configure(bg_color=self.fg_color) @@ -103,4 +102,3 @@ class CTk(tkinter.Tk): self.appearance_mode = 0 super().configure(bg=CTkColorManager.single_color(self.fg_color, self.appearance_mode)) - #self.update_idletasks() diff --git a/documentation_images/themes.jpg b/documentation_images/themes.jpg new file mode 100644 index 0000000..ef42071 Binary files /dev/null and b/documentation_images/themes.jpg differ