[gtk/ebassi/for-master: 10/15] a11y: Set the role on GtkSearchBar




commit adfa0655dfd3cd028659dfd189f70a80e69d0637
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Thu Nov 12 14:54:39 2020 +0000

    a11y: Set the role on GtkSearchBar
    
    The search bar widget has a "SEARCH" landmark role, which is described
    as:
    
        A landmark region that contains a collection of items and
        objects that, as a whole, combine to create a search facility.

 gtk/gtksearchbar.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/gtk/gtksearchbar.c b/gtk/gtksearchbar.c
index 42fdeb2894..3de2353950 100644
--- a/gtk/gtksearchbar.c
+++ b/gtk/gtksearchbar.c
@@ -82,6 +82,10 @@
  * ## Creating a search bar
  *
  * [A simple example](https://gitlab.gnome.org/GNOME/gtk/tree/master/examples/search-bar.c)
+ *
+ * # Accessibility
+ *
+ * GtkSearchBar uses the %GTK_ACCESSIBLE_ROLE_SEARCH role.
  */
 
 typedef struct _GtkSearchBarClass   GtkSearchBarClass;
@@ -336,6 +340,7 @@ gtk_search_bar_class_init (GtkSearchBarClass *klass)
 
   gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
   gtk_widget_class_set_css_name (widget_class, I_("searchbar"));
+  gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_SEARCH);
 }
 
 static void


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