[gtk+/wip/unfocused-fixes: 12/13] cellrenderertoggle: Use the cell renderer's state flags as a base for rendering
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/unfocused-fixes: 12/13] cellrenderertoggle: Use the cell renderer's state flags as a base for rendering
- Date: Sat, 17 Dec 2011 17:22:03 +0000 (UTC)
commit 26feec4862226b3ce88472fb2c06f7aa33bd8b11
Author: Rui Matos <tiagomatos gmail com>
Date: Fri Dec 16 19:49:31 2011 +0000
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.
gtk/gtkcellrenderertoggle.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkcellrenderertoggle.c b/gtk/gtkcellrenderertoggle.c
index 3b4a70e..d75a5f8 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]