summaryrefslogtreecommitdiff
path: root/gtk/gtkcellrenderertoggle.c
diff options
context:
space:
mode:
authorRui Matos <tiagomatos@gmail.com>2011-12-16 19:49:31 +0000
committerRui Matos <tiagomatos@gmail.com>2011-12-19 19:21:15 +0000
commit70970146ca06b51228996171f130b7c20d39b364 (patch)
tree67b1a4c7a5a13e785c93f106df1f84847e3b6ad1 /gtk/gtkcellrenderertoggle.c
parent42d2a1984ca6ec2d1bf613e93a904ace4d384486 (diff)
downloadgtk+-70970146ca06b51228996171f130b7c20d39b364.tar.gz
cellrenderertoggle: Use the cell renderer's state flags as a base for rendering
This allows us to pick the underlying widget's state flags that we don't explicitly set here.
Diffstat (limited to 'gtk/gtkcellrenderertoggle.c')
-rw-r--r--gtk/gtkcellrenderertoggle.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gtk/gtkcellrenderertoggle.c b/gtk/gtkcellrenderertoggle.c
index 3b4a70ec18..d75a5f8dc3 100644
--- a/gtk/gtkcellrenderertoggle.c
+++ b/gtk/gtkcellrenderertoggle.c
@@ -363,10 +363,12 @@ gtk_cell_renderer_toggle_render (GtkCellRenderer *cell,
if (width <= 0 || height <= 0)
return;
+ state = gtk_cell_renderer_get_state (cell, widget, flags);
+
if (!priv->activatable)
- state = GTK_STATE_FLAG_INSENSITIVE;
- else
- state = gtk_cell_renderer_get_state (cell, widget, flags);
+ state |= GTK_STATE_FLAG_INSENSITIVE;
+
+ state &= ~(GTK_STATE_FLAG_INCONSISTENT | GTK_STATE_FLAG_ACTIVE);
if (priv->inconsistent)
state |= GTK_STATE_FLAG_INCONSISTENT;