GNOME Bugzilla – Bug 541385
Allowing Theme Engines to draw images or icons
Last modified: 2011-06-01 03:32:01 UTC
Widgets like GtkImage or GtkCellRendererPixbuf Object draws images or icons by themselves. They should actually allow the theme engine to draw. I found gtk_style_render_icon is being just used to transform an image and return a state transformed pixbuf. As it requires a GtkIconSource object as its argument, making few changes in GtkIconSource, we can actually ask theme engine to draw instead of widgets themselves. The main intention for introducing this feature is to allow theme engine to do some theming (like animation or decoration) on the icons and images
Created attachment 113917 [details] Changes introduced in GtkIconFactory.c for GtkIconSource
(In reply to comment #1) > Created an attachment (id=113917) [edit] > Changes introduced in GtkIconFactory.c for GtkIconSource Comments from a quick look: You introduced API without Since tags. > - > +/* You seem to uncomment quite a bit of code. You should rather remove code, since a) uncommented code is rarely helpful to keep and b) it makes patches much more readable without looking at the actual sources. It would be nice if you could also poste a test case, maybe a patch for a theme engine that would make use of this enhancement. Then it would be much easier to see how useful this actually is.
If you looked a bit at how the code around looks, you would notice that every single line of code you add breaks the coding style.
Christian oh sure, i am currently working on that and will attach the same as soon as i am done. Michael yes i will look into it.
Created attachment 113983 [details] [review] Changes introduced in GtkIconFactory.c for GtkIconSource
Created attachment 113984 [details] [review] Aurora theme engine patch
Created attachment 113985 [details] test application
Created attachment 113986 [details] Aurora midnight gtkrc file
Attaching a new patch for GtkIconSource Attaching a patch for aurora theme engine >> aurora theme engine downloaded from http://www.gnome-look.org/CONTENT/content-files/56438-Aurora-1.4.tar.bz2 Attaching a test application and a gtkrc file
No news on this? I've just bumped into this custom icon rendering in GtkCellRendererPixbuf, and I was thinking about improving this the very same way. This will not only clean the code, but will allow for nice theme effects. Is there anything I can do to help? For me, Varun has provided about everything needed - and even a patch for Aurora!
gtk_theming_engine_render_icon_pixbuf does allow theming engines to override icon drawing in GTK+ 3.x