diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2020-11-12 14:53:16 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2020-11-12 21:46:06 +0000 |
commit | f8bb2060343800e9a51013f61966f60a5caa6bb0 (patch) | |
tree | 0f73f627791ec88a27c461c5ccbb38e669402edb /gtk/gtkbutton.c | |
parent | 87f92a93d3cca735f09fc8e7a8df04ccb7fcc9bb (diff) | |
download | gtk+-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.c | 5 |
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"); |