[gtk+] GtkCheckMenuItemAccessible: Make work with model menu items



commit 8085b410742b2183fd599221f90fff569048b7e8
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jan 4 21:48:19 2014 -0500

    GtkCheckMenuItemAccessible: Make work with model menu items
    
    GtkModelMenuItem does not emit the ::toggled signal when a radio
    item is activated, so listen for property notification for that
    property. We still keep the ::toggled signal handler, in order
    to not break other uses of check and radio menu items.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=720983

 gtk/a11y/gtkcheckmenuitemaccessible.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/gtk/a11y/gtkcheckmenuitemaccessible.c b/gtk/a11y/gtkcheckmenuitemaccessible.c
index 694fec4..e0011f5 100644
--- a/gtk/a11y/gtkcheckmenuitemaccessible.c
+++ b/gtk/a11y/gtkcheckmenuitemaccessible.c
@@ -84,10 +84,12 @@ gtk_check_menu_item_accessible_notify_gtk (GObject    *obj,
   AtkObject *atk_obj;
   gboolean sensitive;
   gboolean inconsistent;
+  gboolean active;
 
   atk_obj = gtk_widget_get_accessible (GTK_WIDGET (check_menu_item));
   sensitive = gtk_widget_get_sensitive (GTK_WIDGET (check_menu_item));
   inconsistent = gtk_check_menu_item_get_inconsistent (check_menu_item);
+  active = gtk_check_menu_item_get_active (check_menu_item);
 
   if (strcmp (pspec->name, "inconsistent") == 0)
     {
@@ -100,6 +102,10 @@ gtk_check_menu_item_accessible_notify_gtk (GObject    *obj,
       atk_object_notify_state_change (atk_obj, ATK_STATE_SENSITIVE, sensitive);
       atk_object_notify_state_change (atk_obj, ATK_STATE_ENABLED, (sensitive && !inconsistent));
     }
+  else if (strcmp (pspec->name, "active") == 0)
+    {
+      atk_object_notify_state_change (atk_obj, ATK_STATE_CHECKED, active);
+    }
   else
     GTK_WIDGET_ACCESSIBLE_CLASS (gtk_check_menu_item_accessible_parent_class)->notify_gtk (obj, pspec);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]