GNOME Bugzilla – Bug 162903
Pixbuf colouring support in CellRendererPixbuf would be nice
Last modified: 2011-02-04 16:18:41 UTC
It would be nice, consistent and not to mention accessible when pixbuf status indicators in a treeview have the same colour as the text, so for instance black normally, and white when selected. In Rhythmbox and Muine a hacked up cell renderer is used for this, but support for this in Gtk+ itself, perhaps through a boolean property in CellRenderPixbuf, would be really nice. In the hacked up cell renderer (which I will attach shortly) the original pixbuf is being colourized to widget->style->text[state].{red,green,blue} and then drawn in _render. For this to work nicely, the image should be drawn in white. If you think this is a good idea, I could try to come up with a patch.
Created attachment 35413 [details] The hacked up cellrenderer
There was a bug around for tinting in cellrendererpixbuf, I'm too lazy to look it up right now though.
Created attachment 36213 [details] [review] proposed patch The patch adds a boolean "colorize" property
2005-01-20 Matthias Clasen <mclasen@redhat.com> Support tinting in GtkCellRendererPixbuf (#162903, Jorn Baayen): * gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_class_init) Add a follow-state property which when TRUE causes the pixbuf to be tinted according to state. * gtk/gtkcellrendererpixbuf.c (gtk_cell_renderer_pixbuf_render): Use follow-state and colorize the pixbuf when appropriate.