TkinterEP / ttkwidgets

A collection of widgets for Tkinter's ttk extensions by various authors
GNU General Public License v3.0
136 stars 28 forks source link

Improve existing checkbox images, easier overrride for new images #67

Open WinEunuuchs2Unix opened 3 years ago

WinEunuuchs2Unix commented 3 years ago

Firstly, CheckboxTreeview() is awesome!

Secondly, the images for "checked", "unchecked" and "tristate" shown below in Gimp at 1600% magnification reveal shadows which shows up on our screens making it harder to tell the difference between images.

Lastly, can we make it easier to pass IM_CHECKED, IM_UNCHECKED and IMTRISTATE keywords to init for the three images? My fonts are on HDPI monitors and such are about 40% larger than the checkboxes so I'll be creating new images. This code I believe needs to be changed to allow passing keyword image arguments:


# checkboxes are implemented with pictures
self.im_checked = ImageTk.PhotoImage(Image.open(IM_CHECKED), master=self)
self.im_unchecked = ImageTk.PhotoImage(Image.open(IM_UNCHECKED), master=self)
self.im_tristate = ImageTk.PhotoImage(Image.open(IM_TRISTATE), master=self)

Gimp screenshot of existing images zoomed to 1600%:

image

RedFantom commented 3 years ago

a490457 contains changes to four lines of code that implement overrides for the state images of CheckboxTreeview, I think that is a good addition. However, I don't quite understand how the shadows make it harder to tell the differences between images. Could you perhaps elaborate on this a bit more?

Tkinter indeed does not offer HiDPI scaling by default, but there are methods to achieve scaling. However, if you do make new images and they can be licensed under GNU GPLv3, please do open a PR, as the addition of new images for HiDPI monitors would be a good enhancement.

WinEunuuchs2Unix commented 3 years ago

@RedFantom I regret suggesting image shadows should be removed. Now I think they are fine. I did write code to generate new images on the fly as font size is increased for HiDPI monitors. I posted the solution in Stack Overflow: CheckboxTreeview() - scale size of checkboxes, change colors. At the same time I allowed changing checkbox outline color, fill color and checked / tristate color. An enhancement to this code would be options for style of check mark and tristate. Another enhancement would be the creation of shadows.

Sorry for delay in replying. I didn't get an email there was a comment here. gmail sends mail to "Forums" folder instead of in-box.