[gcalctool] Add a11y names to widgets



commit 6303909bd4248c31824c5314645a7b3d07a146e3
Author: Robert Ancell <robert ancell gmail com>
Date:   Tue Jul 20 14:28:37 2010 +0200

    Add a11y names to widgets

 NEWS                      |    1 +
 data/buttons-advanced.ui  |    6 ++++++
 data/buttons-financial.ui |    9 +++++++++
 src/math-buttons.c        |    2 ++
 4 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/NEWS b/NEWS
index fba9a9d..4c45602 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@
 Overview of changes in gcalctool 5.31.6
 
     * Fix double pasting into display with middle button
+    * Add a11y names to widgets
 
 Overview of changes in gcalctool 5.31.5
 
diff --git a/data/buttons-advanced.ui b/data/buttons-advanced.ui
index ab7a4f1..6ac97a0 100644
--- a/data/buttons-advanced.ui
+++ b/data/buttons-advanced.ui
@@ -26,6 +26,12 @@
                 <property name="visible">True</property>
                 <property name="xalign">1</property>
                 <property name="label" comments="Example content">3.14159 radians = 180 degrees</property>
+                <child internal-child="accessible">
+                  <object class="AtkObject" id="angle_label-atkobject">
+                    <property name="AtkObject::accessible-name">angle_label</property>
+                    <property name="AtkObject::accessible-description">Displays an angle unit conversion</property>
+                  </object>
+                </child>
               </object>
               <packing>
                 <property name="position">1</property>
diff --git a/data/buttons-financial.ui b/data/buttons-financial.ui
index 0626752..4bb6715 100644
--- a/data/buttons-financial.ui
+++ b/data/buttons-financial.ui
@@ -55,6 +55,12 @@
                 <property name="visible">True</property>
                 <property name="xalign">1</property>
                 <property name="label" comments="Example content">$100 = &#x20AC;120</property>
+                <child internal-child="accessible">
+                  <object class="AtkObject" id="currency_label-atkobject">
+                    <property name="AtkObject::accessible-name">currency_label</property>
+                    <property name="AtkObject::accessible-description">Displays a currency conversion</property>
+                  </object>
+                </child>
               </object>
               <packing>
                 <property name="position">1</property>
@@ -798,6 +804,9 @@
             <child>
               <placeholder/>
             </child>
+            <child>
+              <placeholder/>
+            </child>
           </object>
           <packing>
             <property name="position">1</property>
diff --git a/src/math-buttons.c b/src/math-buttons.c
index 3351ae6..01abb1e 100644
--- a/src/math-buttons.c
+++ b/src/math-buttons.c
@@ -818,6 +818,8 @@ load_mode(MathButtons *buttons, ButtonMode mode)
 
         if (button_data[i].tooltip)
             gtk_widget_set_tooltip_text(button, _(button_data[i].tooltip));
+      
+        atk_object_set_name (gtk_widget_get_accessible (button), button_data[i].widget_name);
 
         switch (button_data[i].class) {
         case NUMBER:



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