[gnome-control-center] power: Improve accessibility



commit 3644a72e593d1bfaa990569f1cbcda951a0109d4
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Feb 10 21:25:24 2013 -0500

    power: Improve accessibility
    
    The battery levelbars should have a labelled-by relation to the
    percentage labels, so orca knows that these two belong together.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=693564

 panels/power/cc-power-panel.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/panels/power/cc-power-panel.c b/panels/power/cc-power-panel.c
index 634b0d5..4d63da2 100644
--- a/panels/power/cc-power-panel.c
+++ b/panels/power/cc-power-panel.c
@@ -362,6 +362,10 @@ set_primary (CcPowerPanel *panel, UpDevice *device)
   gtk_style_context_add_class (gtk_widget_get_style_context (label), GTK_STYLE_CLASS_DIM_LABEL);
   gtk_box_pack_start (GTK_BOX (box2), label, FALSE, TRUE, 0);
 
+  atk_object_add_relationship (gtk_widget_get_accessible (levelbar),
+                               ATK_RELATION_LABELLED_BY,
+                               gtk_widget_get_accessible (label));
+
   gtk_container_add (GTK_CONTAINER (priv->battery_list), box);
   gtk_size_group_add_widget (priv->row_sizegroup, box);
   gtk_widget_show_all (box);
@@ -446,6 +450,11 @@ add_battery (CcPowerPanel *panel, UpDevice *device)
   gtk_size_group_add_widget (priv->level_sizegroup, levelbar);
   gtk_box_pack_start (GTK_BOX (box), box2, TRUE, TRUE, 0);
 
+  atk_object_add_relationship (gtk_widget_get_accessible (levelbar),
+                               ATK_RELATION_LABELLED_BY,
+                               gtk_widget_get_accessible (label));
+
+
   g_object_set_data (G_OBJECT (box), "kind", GINT_TO_POINTER (kind));
   gtk_container_add (GTK_CONTAINER (priv->battery_list), box);
   gtk_size_group_add_widget (priv->row_sizegroup, box);


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