added screenshots for Windows

This commit is contained in:
Tom Schimansky 2021-11-10 23:18:04 +01:00
parent 4301419228
commit e6d71058aa
7 changed files with 22 additions and 4 deletions

View File

@ -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``.

View File

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

View File

@ -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:

View File

@ -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:

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

View File

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