summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2020-11-12 16:04:30 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2020-11-12 21:46:06 +0000
commitebda736a09bc96650cfbb3612d2a83b3454a542e (patch)
tree2422678cb6cfa12c459ef96c82c8a9d7ad46bb87
parentd4ddfdc265c33d5876e56f6faf243df48470fa13 (diff)
downloadgtk+-ebda736a09bc96650cfbb3612d2a83b3454a542e.tar.gz
a11y: Mark SearchEntry icons as presentational
While the "clear the search entry" icon behaves like a button, we don't have any actual action that can trigger it, so let's ignore it.
-rw-r--r--gtk/gtksearchentry.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gtk/gtksearchentry.c b/gtk/gtksearchentry.c
index c3662a0e1c..86338ee3b4 100644
--- a/gtk/gtksearchentry.c
+++ b/gtk/gtksearchentry.c
@@ -554,8 +554,9 @@ gtk_search_entry_init (GtkSearchEntry *entry)
GtkWidget *icon;
GtkGesture *press;
+ /* The search icon is purely presentational */
icon = g_object_new (GTK_TYPE_IMAGE,
- "accessible-role", GTK_ACCESSIBLE_ROLE_NONE,
+ "accessible-role", GTK_ACCESSIBLE_ROLE_PRESENTATION,
"icon-name", "system-search-symbolic",
NULL);
gtk_widget_set_parent (icon, GTK_WIDGET (entry));
@@ -570,7 +571,10 @@ gtk_search_entry_init (GtkSearchEntry *entry)
g_signal_connect (entry->entry, "notify", G_CALLBACK (notify_cb), entry);
g_signal_connect (entry->entry, "activate", G_CALLBACK (activate_cb), entry);
- entry->icon = gtk_image_new_from_icon_name ("edit-clear-symbolic");
+ entry->icon = g_object_new (GTK_TYPE_IMAGE,
+ "accessible-role", GTK_ACCESSIBLE_ROLE_PRESENTATION,
+ "icon-name", "edit-clear-symbolic",
+ NULL);
gtk_widget_set_tooltip_text (entry->icon, _("Clear entry"));
gtk_widget_set_parent (entry->icon, GTK_WIDGET (entry));
gtk_widget_set_child_visible (entry->icon, FALSE);