mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 13:41:07 +00:00
Notify ATK_STATE_ENABLED change when ATK_STATE_SENSITIVE changes if necessary.
Bug #615999.
This commit is contained in:
parent
95fd5011c2
commit
3f78773862
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user