[gtk+] Small improvement to GtkLinkButton a11y



commit bdd4d65e85e9de0a5dc9d9de088eba7c1b8006ae
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Sep 21 20:29:09 2013 -0400

    Small improvement to GtkLinkButton a11y
    
    ATK has a visited state, so propagate the visited property
    of GtkLinkButton to that state.

 gtk/a11y/gtklinkbuttonaccessible.c |   19 +++++++++++++++++++
 testsuite/a11y/link.txt            |    2 +-
 testsuite/a11y/link.ui             |    1 +
 3 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/gtk/a11y/gtklinkbuttonaccessible.c b/gtk/a11y/gtklinkbuttonaccessible.c
index 19ffe55..bac91cf 100644
--- a/gtk/a11y/gtklinkbuttonaccessible.c
+++ b/gtk/a11y/gtklinkbuttonaccessible.c
@@ -218,10 +218,29 @@ gtk_link_button_accessible_finalize (GObject *object)
   G_OBJECT_CLASS (gtk_link_button_accessible_parent_class)->finalize (object);
 }
 
+static AtkStateSet *
+gtk_link_button_ref_state_set (AtkObject *accessible)
+{
+  AtkStateSet *state_set;
+  GtkWidget *widget;
+
+  state_set = ATK_OBJECT_CLASS (gtk_link_button_accessible_parent_class)->ref_state_set (accessible);
+
+  widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (accessible));
+  if (widget != NULL)
+    {
+      if (gtk_link_button_get_visited (GTK_LINK_BUTTON (widget)))
+        atk_state_set_add_state (state_set, ATK_STATE_VISITED);
+    }
+
+  return state_set;
+}
+
 static void
 gtk_link_button_accessible_class_init (GtkLinkButtonAccessibleClass *klass)
 {
   G_OBJECT_CLASS (klass)->finalize = gtk_link_button_accessible_finalize;
+  ATK_OBJECT_CLASS (klass)->ref_state_set = gtk_link_button_ref_state_set;
 }
 
 static void
diff --git a/testsuite/a11y/link.txt b/testsuite/a11y/link.txt
index c560183..e94e9c3 100644
--- a/testsuite/a11y/link.txt
+++ b/testsuite/a11y/link.txt
@@ -11,7 +11,7 @@ window1
     parent: window1
     index: 0
     name: Hello World!
-    state: enabled focusable sensitive showing visible
+    state: enabled focusable sensitive showing visible visited
     toolkit: gtk
     <AtkComponent>
     layer: widget
diff --git a/testsuite/a11y/link.ui b/testsuite/a11y/link.ui
index d8cff27..2777a69 100644
--- a/testsuite/a11y/link.ui
+++ b/testsuite/a11y/link.ui
@@ -10,6 +10,7 @@
         <property name="visible">True</property>
         <property name="can_focus">True</property>
         <property name="uri">http://www.gtk.org</property>
+        <property name="visited">True</property>
       </object>
     </child>
   </object>


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