[gtk/a11y/atcontext-realize] a11y: Make the Button labelled by its child label
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/a11y/atcontext-realize] a11y: Make the Button labelled by its child label
- Date: Wed, 4 Nov 2020 17:16:40 +0000 (UTC)
commit 72415eaa4913568dbb9c0c433949f120a6a246ab
Author: Emmanuele Bassi <ebassi gnome org>
Date: Wed Nov 4 16:43:59 2020 +0000
a11y: Make the Button labelled by its child label
Establish the relation whenever we set the label widget.
gtk/gtkbutton.c | 5 +++++
1 file changed, 5 insertions(+)
---
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index 91023ce39e..f964eb7495 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -938,6 +938,11 @@ gtk_button_set_icon_name (GtkButton *button,
gtk_image_set_from_icon_name (GTK_IMAGE (priv->child), icon_name);
}
+ gtk_accessible_update_relation (GTK_ACCESSIBLE (button),
+ GTK_ACCESSIBLE_RELATION_LABELLED_BY,
+ g_list_append (NULL, priv->child),
+ -1);
+
gtk_button_set_child_type (button, ICON_CHILD);
g_object_notify_by_pspec (G_OBJECT (button), props[PROP_ICON_NAME]);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]