Make toggle cell renderer follow insensitive state of widget

Likewise to other cell renderers, GtkCellRendererToggle now properly
follows the insensitive state of the widget requesting rendering.  It
does this by checking the state of the widget pointer, not by using
GtkCellRendererFlags (there exists an insensitive flags).  Later on, I
think we should move to using GtkCellRendererFlags and not the state of
the widget requesting rendering.  Patch merged from maemo-gtk.
This commit is contained in:
Kristian Rietveld 2009-09-04 13:21:26 +02:00
parent 6f20cf691e
commit 4f219692ed

View File

@ -349,7 +349,7 @@ gtk_cell_renderer_toggle_render (GtkCellRenderer *cell,
else else
shadow = celltoggle->active ? GTK_SHADOW_IN : GTK_SHADOW_OUT; shadow = celltoggle->active ? GTK_SHADOW_IN : GTK_SHADOW_OUT;
if (!cell->sensitive) if (GTK_WIDGET_STATE (widget) == GTK_STATE_INSENSITIVE || !cell->sensitive)
{ {
state = GTK_STATE_INSENSITIVE; state = GTK_STATE_INSENSITIVE;
} }