[libadwaita/wip/exalm/a11y-fixes: 13/14] preferences-group: Set accessible role




commit 7b3af162f32f50fc0502f4e1117c5745247eff35
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Mon Dec 27 18:06:52 2021 +0500

    preferences-group: Set accessible role

 src/adw-preferences-group.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/adw-preferences-group.c b/src/adw-preferences-group.c
index 320ea0b3..5a74ecc1 100644
--- a/src/adw-preferences-group.c
+++ b/src/adw-preferences-group.c
@@ -39,6 +39,10 @@
  *
  * `AdwPreferencesGroup` has a single CSS node with name `preferencesgroup`.
  *
+ * ## Accessibility
+ *
+ * `AdwPreferencesGroup` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
+ *
  * Since: 1.0
  */
 
@@ -215,8 +219,6 @@ adw_preferences_group_class_init (AdwPreferencesGroupClass *klass)
 
   g_object_class_install_properties (object_class, LAST_PROP, props);
 
-  gtk_widget_class_set_css_name (widget_class, "preferencesgroup");
-  gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
   gtk_widget_class_set_template_from_resource (widget_class,
                                                "/org/gnome/Adwaita/ui/adw-preferences-group.ui");
   gtk_widget_class_bind_template_child_private (widget_class, AdwPreferencesGroup, box);
@@ -225,6 +227,10 @@ adw_preferences_group_class_init (AdwPreferencesGroupClass *klass)
   gtk_widget_class_bind_template_child_private (widget_class, AdwPreferencesGroup, listbox_box);
   gtk_widget_class_bind_template_child_private (widget_class, AdwPreferencesGroup, title);
   gtk_widget_class_bind_template_callback (widget_class, listbox_keynav_failed_cb);
+
+  gtk_widget_class_set_css_name (widget_class, "preferencesgroup");
+  gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_GROUP);
+  gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
 }
 
 static void


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