[gtk/a11y/atspi] flowbox: Set accessible roles



commit 14640cec85c5cf4f964830456dbe6655c39f80fd
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Oct 14 22:18:31 2020 -0400

    flowbox: Set accessible roles
    
    Use the GRID and GRID_CELL roles for GtkFlowBox
    and GtkFlowBoxChild.

 docs/reference/gtk/section-accessibility.md | 2 ++
 gtk/gtkenums.h                              | 4 ++--
 gtk/gtkflowbox.c                            | 2 ++
 3 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/docs/reference/gtk/section-accessibility.md b/docs/reference/gtk/section-accessibility.md
index 01adae2898..37309df83b 100644
--- a/docs/reference/gtk/section-accessibility.md
+++ b/docs/reference/gtk/section-accessibility.md
@@ -49,6 +49,8 @@ Each role name is part of the #GtkAccessibleRole enumeration.
 | `CHECKBOX` | A control that has three possible value: `true`, `false`, or `undefined` | #GtkCheckButton |
 | `COMBOBOX` | A control that can be expanded to show a list of possible values to select | #GtkComboBox |
 | `DIALOG` | A dialog that prompts the user to enter information or require a response | #GtkDialog and 
subclasses |
+| `GRID` | A grid of items | #GtkFlowBox |
+| `GRID_CELL` | An item in a grid | #GtkFlowBoxChild |
 | `IMG` | An image | #GtkImage, #GtkPicture |
 | `LABEL` | A visible name or caption for a user interface component | #GtkLabel |
 | `LIST` | A list of items | #GtkListBox |
diff --git a/gtk/gtkenums.h b/gtk/gtkenums.h
index b33f29ba82..4aa4b8b4e6 100644
--- a/gtk/gtkenums.h
+++ b/gtk/gtkenums.h
@@ -1175,8 +1175,8 @@ typedef enum {
  * @GTK_ACCESSIBLE_ROLE_FEED: Unused
  * @GTK_ACCESSIBLE_ROLE_FORM: Unused
  * @GTK_ACCESSIBLE_ROLE_GENERIC: Unused
- * @GTK_ACCESSIBLE_ROLE_GRID: Unused
- * @GTK_ACCESSIBLE_ROLE_GRID_CELL: Unused
+ * @GTK_ACCESSIBLE_ROLE_GRID: A grid of items.
+ * @GTK_ACCESSIBLE_ROLE_GRID_CELL: An item in a grid.
  * @GTK_ACCESSIBLE_ROLE_GROUP: Unused
  * @GTK_ACCESSIBLE_ROLE_HEADING: Unused
  * @GTK_ACCESSIBLE_ROLE_IMG: An image.
diff --git a/gtk/gtkflowbox.c b/gtk/gtkflowbox.c
index f7f60c9bcb..8d01400835 100644
--- a/gtk/gtkflowbox.c
+++ b/gtk/gtkflowbox.c
@@ -547,6 +547,7 @@ gtk_flow_box_child_class_init (GtkFlowBoxChildClass *class)
 
   gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
   gtk_widget_class_set_css_name (widget_class, I_("flowboxchild"));
+  gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_GRID_CELL);
 }
 
 static void
@@ -3887,6 +3888,7 @@ gtk_flow_box_class_init (GtkFlowBoxClass *class)
                                        NULL);
 
   gtk_widget_class_set_css_name (widget_class, I_("flowbox"));
+  gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_GRID);
 }
 
 static void


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