diff --git a/Readme.md b/Readme.md index 2087443..fe624ae 100644 --- a/Readme.md +++ b/Readme.md @@ -116,6 +116,24 @@ colors and removed the round corners, and added a border to the buttons: ![](documentation_images/complex_example_other_style.png) +### Customtkinter on Windows/Linux + +All elements of Customtkinter are drawn on the ```tkinter.Canvas```. +But the Tkinter canvas supports antialiasing only on macOS, so on Windows +and Linux the elements are rendered in a much worse quality. So you have +to experiment with the ```corner_radius``` and look when the rounded corners +look best. I tried to design the too complex example programs so that they +also look acceptable on Windows. Maybe you can use the parameters for +```corner_radius``` and ```width``` for your program as well. + +Example 1:```examples/complex_example.py``` + +![](documentation_images/Windows_light.png) + +Example 2: ```examples/complex_example_other_style.py``` + +![](documentation_images/Windows_dark.png) + ### CTkButton with images It's also possible to put an image on a CTkButton. You just have to pass a PhotoImage object to the CTkButton with the argument ``image``. diff --git a/customtkinter/customtkinter_checkbox.py b/customtkinter/customtkinter_checkbox.py index 8e8de76..74f1b41 100644 --- a/customtkinter/customtkinter_checkbox.py +++ b/customtkinter/customtkinter_checkbox.py @@ -17,7 +17,7 @@ class CTkCheckBox(tkinter.Frame): border_width=3, width=25, height=25, - corner_radius=5, + corner_radius=4, text_font=None, text_color=CTkColorManager.TEXT, text="CTkCheckBox", diff --git a/customtkinter/customtkinter_progressbar.py b/customtkinter/customtkinter_progressbar.py index 584cc6a..003882e 100644 --- a/customtkinter/customtkinter_progressbar.py +++ b/customtkinter/customtkinter_progressbar.py @@ -136,7 +136,7 @@ class CTkProgressBar(tkinter.Frame): else: # ovals and rects are always rendered too large on Windows and need to be made smaller by -1 oval_bottom_right_shift = -1 - rect_bottom_right_shift = -1 + rect_bottom_right_shift = -0 # frame_border if self.border_width > 0: diff --git a/customtkinter/customtkinter_slider.py b/customtkinter/customtkinter_slider.py index e448c07..7e4cbba 100644 --- a/customtkinter/customtkinter_slider.py +++ b/customtkinter/customtkinter_slider.py @@ -147,7 +147,7 @@ class CTkSlider(tkinter.Frame): # ovals and rects are always rendered too large and need to be made smaller by -1 oval_bottom_right_shift = -1 - rect_bottom_right_shift = -1 + rect_bottom_right_shift = 0 # frame_border if self.border_width > 0: diff --git a/documentation_images/Windows_dark.png b/documentation_images/Windows_dark.png new file mode 100755 index 0000000..9919add Binary files /dev/null and b/documentation_images/Windows_dark.png differ diff --git a/documentation_images/Windows_light.png b/documentation_images/Windows_light.png new file mode 100755 index 0000000..d1e92db Binary files /dev/null and b/documentation_images/Windows_light.png differ diff --git a/examples/complex_example.py b/examples/complex_example.py index 30abaf5..5d22bb6 100644 --- a/examples/complex_example.py +++ b/examples/complex_example.py @@ -130,7 +130,7 @@ class App(tkinter.Tk): self.entry = customtkinter.CTkEntry(master=self.frame_right, width=120, height=25, - corner_radius=10) + corner_radius=8) self.entry.place(relx=0.33, rely=0.92, anchor=tkinter.CENTER) self.entry.insert(0, "CTkEntry")