[gnome-control-center] notifications: Make section headings accessible



commit 3c710f1f32198a4b6cac9083ef89a28dca47180c
Author: Martin Hatina <mhatina redhat com>
Date:   Tue May 5 09:45:25 2015 +0200

    notifications: Make section headings accessible
    
    The section headings are useful to understand the content of this panel.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=746757

 panels/notifications/cc-notifications-panel.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/panels/notifications/cc-notifications-panel.c b/panels/notifications/cc-notifications-panel.c
index 7a176ae..e4ab495 100644
--- a/panels/notifications/cc-notifications-panel.c
+++ b/panels/notifications/cc-notifications-panel.c
@@ -142,6 +142,7 @@ static void
 cc_notifications_panel_init (CcNotificationsPanel *panel)
 {
   GtkWidget *w;
+  GtkWidget *label;
   GError *error = NULL;
 
   g_resources_register (cc_notifications_get_resource ());
@@ -184,8 +185,17 @@ cc_notifications_panel_init (CcNotificationsPanel *panel)
                                 cc_list_box_update_header_func,
                                 NULL, NULL);
 
+  label = GTK_WIDGET (gtk_builder_get_object (panel->builder,
+                                              "label1"));
   w = GTK_WIDGET (gtk_builder_get_object (panel->builder,
                                           "ccnotify-app-listbox"));
+  atk_object_add_relationship (ATK_OBJECT (gtk_widget_get_accessible (label)),
+                               ATK_RELATION_LABEL_FOR,
+                               ATK_OBJECT (gtk_widget_get_accessible (w)));
+  atk_object_add_relationship (ATK_OBJECT (gtk_widget_get_accessible (w)),
+                               ATK_RELATION_LABELLED_BY,
+                               ATK_OBJECT (gtk_widget_get_accessible (label)));
+
   panel->sections = g_list_append (panel->sections, w);
   panel->sections_reverse = g_list_prepend (panel->sections_reverse, w);
   g_signal_connect (w, "keynav-failed", G_CALLBACK (keynav_failed), panel);


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