summaryrefslogtreecommitdiff
path: root/gtk/gtkbutton.c
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2020-11-12 14:53:16 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2020-11-12 21:46:06 +0000
commitf8bb2060343800e9a51013f61966f60a5caa6bb0 (patch)
tree0f73f627791ec88a27c461c5ccbb38e669402edb /gtk/gtkbutton.c
parent87f92a93d3cca735f09fc8e7a8df04ccb7fcc9bb (diff)
downloadgtk+-f8bb2060343800e9a51013f61966f60a5caa6bb0.tar.gz
a11y: Icons in buttons are presentational
Buttons are described by text, and the icon child can be safely ignored.
Diffstat (limited to 'gtk/gtkbutton.c')
-rw-r--r--gtk/gtkbutton.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c
index 059853106a..9e9a15a422 100644
--- a/gtk/gtkbutton.c
+++ b/gtk/gtkbutton.c
@@ -927,7 +927,10 @@ gtk_button_set_icon_name (GtkButton *button,
if (priv->child_type != ICON_CHILD || priv->child == NULL)
{
- GtkWidget *child = gtk_image_new_from_icon_name (icon_name);
+ GtkWidget *child = g_object_new (GTK_TYPE_IMAGE,
+ "accessible-role", GTK_ACCESSIBLE_ROLE_PRESENTATION,
+ "icon-name", icon_name,
+ NULL);
gtk_button_set_child (GTK_BUTTON (button), child);
gtk_widget_set_valign (child, GTK_ALIGN_CENTER);
gtk_widget_remove_css_class (GTK_WIDGET (button), "text-button");