Commit 70d2c392 authored by Joanmarie Diggs's avatar Joanmarie Diggs Committed by Tristan Van Berkom

Add/Remove ATK_STATE_SENSITIVE according to cells' state.

Bug #569042.
parent fe0a89e2
......@@ -32,6 +32,7 @@ static gboolean gail_boolean_cell_update_cache (GailRendererCell *ce
gchar *gail_boolean_cell_property_list[] = {
"active",
"radio",
"sensitive",
NULL
};
......@@ -73,6 +74,7 @@ gail_boolean_cell_new (void)
cell->renderer = gtk_cell_renderer_toggle_new ();
g_object_ref_sink (cell->renderer);
boolean_cell->cell_value = FALSE;
boolean_cell->cell_sensitive = TRUE;
return atk_object;
}
......@@ -83,8 +85,10 @@ gail_boolean_cell_update_cache (GailRendererCell *cell,
GailBooleanCell *boolean_cell = GAIL_BOOLEAN_CELL (cell);
gboolean rv = FALSE;
gboolean new_boolean;
gboolean new_sensitive;
g_object_get (G_OBJECT(cell->renderer), "active", &new_boolean, NULL);
g_object_get (G_OBJECT(cell->renderer), "active", &new_boolean,
"sensitive", &new_sensitive, NULL);
if (boolean_cell->cell_value != new_boolean)
{
......@@ -99,5 +103,18 @@ gail_boolean_cell_update_cache (GailRendererCell *cell,
gail_cell_remove_state (GAIL_CELL (cell), ATK_STATE_CHECKED, emit_change_signal);
}
if (boolean_cell->cell_sensitive != new_sensitive)
{
rv = TRUE;
boolean_cell->cell_sensitive = !(boolean_cell->cell_sensitive);
/* Update cell's state */
if (new_sensitive)
gail_cell_add_state (GAIL_CELL (cell), ATK_STATE_SENSITIVE, emit_change_signal);
else
gail_cell_remove_state (GAIL_CELL (cell), ATK_STATE_SENSITIVE, emit_change_signal);
}
return rv;
}
......@@ -39,6 +39,7 @@ struct _GailBooleanCell
{
GailRendererCell parent;
gboolean cell_value;
gboolean cell_sensitive;
};
GType gail_boolean_cell_get_type (void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment