-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Making this ready for publication #1
Comments
I finally find the way for this: https://www.tcl.tk/man/tcl/TkCmd/photo.htm#M39. I don't know that Tk has transparency control, because Tkinter does not support it (along with many other useful features), but we can do it with self.tk.call(self.name, 'transparency', 'get', x, y) # Returns a boolean indicating if the pixel at (x, y) is transparent.
self.tk.call(self.name, 'transparency', 'set', x, y, is_transparent) # Makes the pixel at (x,y) transparent if boolean is true |
That is certainly an interesting feature, but that's not necessarily how I intended to implement that feature. The key problem with PNG themes over GIF themes is performance due to the alpha channel. There can be transparency in the image, but a full alpha channel with varying opacity is too much. Therefore, what I thought could work is the following:
However, I am rather curious if the method that you suggest can also provide the performance improvement that removing the alpha channel from the PNG images would have. I have relatively little time again now, so I'll probably not get around to it for a bit. However, I have implemented the build system for |
Okay, I read on and found out that you don't even have to check the transparency per pixel and remove it, but you can go straight to the write method so you can save it in either png or gif format. Of course, we can also make base64 with the base64 module. The other very good thing is that it gives all the alpha channel parts the background you specified. self.tk.call(self.name, 'write', filename, '-format', format, '-background', color) I installed |
If that command can do what I think it might, that would be an absolutely awesomely useful thing. I'm going to try it soon! I'm glad you like Also, if you want me to direct my attention to a specific thing, please let me know. I'm currently focused on getting |
I have no issues with I stopped working on the NumberEntry widget, and rather started to implement the suggestions I made for Color and Fontchooser. |
Now that Isn't there some way to call InkScape from the command line and export the SVG images in that way? That's more of a Linux-y thing to do, maybe, but with PowerShell there should be lots of options, right? InkScape does appear to have some support for it. I'm not sure about adding an |
I saw your work on |
I'm glad you like it! The I just thought I'd let you know: I've been extraordinarily busy the past few days and it looks like I will be for what looks like at least until next week. I'll have barely any time and energy to spend on any of these projects. Maybe I'll find a gap to review the PRs on Your input has been really valuable so far, so I'm looking forward to seeing whether you can get an SVG version of the theme to work! |
So, I thought I'd add a TODO list of what I'd still like to do with this package before I think it's ready for publication. Feel free to add your own points, @rdbende , so we can discuss them here!
TODO List
tkextrafont
tkextrafont
to PyPI from that repositorytksvg
/Tk 8.7tksvg
to PyPI from that repositorySupport for defining themes in Python, CSS or some other additional method. Could work in conjunction with the GTK theme parser.
Investigate the possibility of loading PNG images into PhotoImages and dropping the alpha channel from them on-the-fly to improve application performance while removing the need for separate GIF-based themes.
Themes ready at release
These are all themes I'd like to have in a separate repository. Whether they should also be PyPI packages is TBD.
Yaru
: Needs tristate images,Switch
images + Report theme formatting oddities and ui inconsistencies here ttkthemes#44Adapta
: Needs tristate images,Switch
images + Report theme formatting oddities and ui inconsistencies here ttkthemes#44Azure
Equilux
Yaru-dark
?Adapta
-variants? (Make this an automatic process? There's lots of themes based off of Adapta)Stretch Goals
darkdetect
Suspended Features
Either take the GTK theme parser from the
ttkstyles/gtk
directory where it currently resides and make it suitable for parsing arbitrary GTK themes or drop the idea completelyThe text was updated successfully, but these errors were encountered: