After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 162903 - Pixbuf colouring support in CellRendererPixbuf would be nice
Pixbuf colouring support in CellRendererPixbuf would be nice
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkTreeView
2.6.x
Other Linux
: Normal enhancement
: ---
Assigned To: gtktreeview-bugs
gtktreeview-bugs
Depends on: 148144
Blocks:
 
 
Reported: 2005-01-04 09:48 UTC by Jorn Baayen
Modified: 2011-02-04 16:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
The hacked up cellrenderer (10.44 KB, text/plain)
2005-01-04 09:49 UTC, Jorn Baayen
  Details
proposed patch (5.32 KB, patch)
2005-01-18 21:26 UTC, Matthias Clasen
none Details | Review

Description Jorn Baayen 2005-01-04 09:48:34 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.
Comment 1 Jorn Baayen 2005-01-04 09:49:07 UTC
Created attachment 35413 [details]
The hacked up cellrenderer
Comment 2 Matthias Clasen 2005-01-04 17:12:23 UTC
There was a bug around for tinting in cellrendererpixbuf, I'm too lazy to look
it up right now though.
Comment 3 Matthias Clasen 2005-01-18 21:26:12 UTC
Created attachment 36213 [details] [review]
proposed patch

The patch adds a boolean "colorize" property
Comment 4 Matthias Clasen 2005-01-20 19:13:03 UTC
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.