Notify ATK_STATE_ENABLED change when ATK_STATE_SENSITIVE changes if necessary.

Bug #615999.
This commit is contained in:
Mike Gorse 2010-04-22 12:24:41 +08:00 committed by Li Yuan
parent 95fd5011c2
commit 3f78773862
4 changed files with 42 additions and 3 deletions

View File

@ -138,7 +138,19 @@ gail_check_menu_item_real_notify_gtk (GObject *obj,
if (strcmp (pspec->name, "inconsistent") == 0)
atk_object_notify_state_change (atk_obj, ATK_STATE_ENABLED,
!gtk_check_menu_item_get_inconsistent (check_menu_item));
(gtk_widget_get_sensitive (GTK_WIDGET (check_menu_item)) &&
!gtk_check_menu_item_get_inconsistent (check_menu_item)));
else if (strcmp (pspec->name, "sensitive") == 0)
{
/* Need to override gailwidget behavior of notifying for ENABLED */
gboolean sensitive;
gboolean enabled;
sensitive = gtk_widget_get_sensitive (GTK_WIDGET (check_menu_item));
enabled = sensitive &&
!gtk_check_menu_item_get_inconsistent (check_menu_item);
atk_object_notify_state_change (atk_obj, ATK_STATE_SENSITIVE, sensitive);
atk_object_notify_state_change (atk_obj, ATK_STATE_ENABLED, enabled);
}
else
GAIL_WIDGET_CLASS (gail_check_menu_item_parent_class)->notify_gtk (obj, pspec);
}

View File

@ -135,7 +135,19 @@ gail_check_sub_menu_item_real_notify_gtk (GObject *obj,
if (strcmp (pspec->name, "inconsistent") == 0)
atk_object_notify_state_change (atk_obj, ATK_STATE_ENABLED,
!gtk_check_menu_item_get_inconsistent (check_menu_item));
(gtk_widget_get_sensitive (GTK_WIDGET (check_menu_item)) &&
!gtk_check_menu_item_get_inconsistent (check_menu_item)));
else if (strcmp (pspec->name, "sensitive") == 0)
{
/* Need to override gailwidget behavior of notifying for ENABLED */
gboolean sensitive;
gboolean enabled;
sensitive = gtk_widget_get_sensitive (GTK_WIDGET (check_menu_item));
enabled = sensitive &&
!gtk_check_menu_item_get_inconsistent (check_menu_item);
atk_object_notify_state_change (atk_obj, ATK_STATE_SENSITIVE, sensitive);
atk_object_notify_state_change (atk_obj, ATK_STATE_ENABLED, enabled);
}
else
GAIL_WIDGET_CLASS (gail_check_sub_menu_item_parent_class)->notify_gtk (obj, pspec);
}

View File

@ -122,7 +122,19 @@ gail_toggle_button_real_notify_gtk (GObject *obj,
if (strcmp (pspec->name, "inconsistent") == 0)
atk_object_notify_state_change (atk_obj, ATK_STATE_ENABLED,
!gtk_toggle_button_get_inconsistent (toggle_button));
(gtk_widget_get_sensitive (GTK_WIDGET (toggle_button)) &&
!gtk_toggle_button_get_inconsistent (toggle_button)));
else if (strcmp (pspec->name, "sensitive") == 0)
{
/* Need to override gailwidget behavior of notifying for ENABLED */
gboolean sensitive;
gboolean enabled;
sensitive = gtk_widget_get_sensitive (GTK_WIDGET (toggle_button));
enabled = sensitive &&
!gtk_toggle_button_get_inconsistent (toggle_button);
atk_object_notify_state_change (atk_obj, ATK_STATE_SENSITIVE, sensitive);
atk_object_notify_state_change (atk_obj, ATK_STATE_ENABLED, enabled);
}
else
GAIL_WIDGET_CLASS (gail_toggle_button_parent_class)->notify_gtk (obj, pspec);
}

View File

@ -997,6 +997,9 @@ gail_widget_real_notify_gtk (GObject *obj,
return;
atk_object_notify_state_change (atk_obj, state, value);
if (state == ATK_STATE_SENSITIVE)
atk_object_notify_state_change (atk_obj, ATK_STATE_ENABLED, value);
}
static void