[gtk/ebassi/for-master: 11/15] a11y: Mark SearchEntry icons as presentational




commit 8aea0e0d75819f1284b3f6179d1f773806692c1b
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Thu Nov 12 16:04:30 2020 +0000

    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.

 gtk/gtksearchentry.c | 8 ++++++--
 1 file 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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]