diff options
author | Li Yuan <li.yuan@sun.com> | 2006-06-05 17:40:25 +0800 |
---|---|---|
committer | Li Yuan <liyuan@src.gnome.org> | 2006-06-05 17:40:25 +0800 |
commit | 7b66244b517d5d6cba73e41e37c10f09ab2e506b (patch) | |
tree | f1b2dab5c196d9ebd9cc0a98c87121c0f10e9d2d /calendar/gui | |
parent | 64f2944a027279c9554c229319b38a6c07ac96e4 (diff) | |
download | gsoc2013-evolution-7b66244b517d5d6cba73e41e37c10f09ab2e506b.tar.gz gsoc2013-evolution-7b66244b517d5d6cba73e41e37c10f09ab2e506b.tar.zst gsoc2013-evolution-7b66244b517d5d6cba73e41e37c10f09ab2e506b.zip |
add labelled by relationship between label and e-timezone-entry. add
2006-06-05 Li Yuan <li.yuan@sun.com>
* gui/dialogs/cal-prefs-dialog.glade:
add labelled by relationship between label and e-timezone-entry.
* gui/e-timezone-entry.c: (add_relation),
(e_timezone_entry_set_timezone):
add relationship between label and entry.
svn path=/trunk/; revision=32078
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/dialogs/cal-prefs-dialog.glade | 5 | ||||
-rw-r--r-- | calendar/gui/e-timezone-entry.c | 44 |
2 files changed, 48 insertions, 1 deletions
diff --git a/calendar/gui/dialogs/cal-prefs-dialog.glade b/calendar/gui/dialogs/cal-prefs-dialog.glade index 068c157087..86333965bd 100644 --- a/calendar/gui/dialogs/cal-prefs-dialog.glade +++ b/calendar/gui/dialogs/cal-prefs-dialog.glade @@ -103,7 +103,7 @@ <property name="column_spacing">6</property> <child> - <widget class="GtkLabel" id="label10"> + <widget class="GtkLabel" id="timezone_label"> <property name="visible">True</property> <property name="label" translatable="yes">Time _zone:</property> <property name="use_underline">True</property> @@ -165,6 +165,9 @@ <property name="int1">0</property> <property name="int2">0</property> <property name="last_modification_time">Thu, 13 Jan 2005 04:18:03 GMT</property> + <accessibility> + <atkrelation target="timezone_label" type="labelled-by"/> + </accessibility> </widget> <packing> <property name="left_attach">1</property> diff --git a/calendar/gui/e-timezone-entry.c b/calendar/gui/e-timezone-entry.c index fe57453540..e708a03618 100644 --- a/calendar/gui/e-timezone-entry.c +++ b/calendar/gui/e-timezone-entry.c @@ -71,6 +71,8 @@ static void on_entry_changed (GtkEntry *entry, ETimezoneEntry *tentry); static void on_button_clicked (GtkWidget *widget, ETimezoneEntry *tentry); +static void add_relation (ETimezoneEntry *tentry, + GtkWidget *widget); static void e_timezone_entry_set_entry (ETimezoneEntry *tentry); @@ -224,6 +226,46 @@ e_timezone_entry_get_timezone (ETimezoneEntry *tentry) return priv->zone; } +static void +add_relation (ETimezoneEntry *tentry, + GtkWidget *widget) +{ + AtkObject *a11ytentry, *a11yWidget; + AtkRelationSet *set; + AtkRelation *relation; + GPtrArray *target; + gpointer target_object; + + /* add a labelled_by relation for widget for accessibility */ + + a11ytentry = gtk_widget_get_accessible (GTK_WIDGET (tentry)); + a11yWidget = gtk_widget_get_accessible (widget); + + set = atk_object_ref_relation_set (a11yWidget); + if (set != NULL) { + relation = atk_relation_set_get_relation_by_type (set, + ATK_RELATION_LABELLED_BY); + /* check whether has a labelled_by relation already */ + if (relation != NULL) + return; + } + + set = atk_object_ref_relation_set (a11ytentry); + if (!set) + return; + + relation = atk_relation_set_get_relation_by_type (set, + ATK_RELATION_LABELLED_BY); + if (relation != NULL) { + target = atk_relation_get_target (relation); + target_object = g_ptr_array_index (target, 0); + if (ATK_IS_OBJECT (target_object)) { + atk_object_add_relationship (a11yWidget, + ATK_RELATION_LABELLED_BY, + ATK_OBJECT (target_object)); + } + } +} void e_timezone_entry_set_timezone (ETimezoneEntry *tentry, @@ -238,6 +280,8 @@ e_timezone_entry_set_timezone (ETimezoneEntry *tentry, priv->zone = zone; e_timezone_entry_set_entry (tentry); + + add_relation (tentry, priv->entry); } |