summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-10-14 22:18:31 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-10-14 22:20:43 -0400
commit14640cec85c5cf4f964830456dbe6655c39f80fd (patch)
tree569f04f8e8f086e302474754313b62a485412b16
parent147868a30c61c45f1ef0d073a09db18f15d12bd9 (diff)
downloadgtk+-14640cec85c5cf4f964830456dbe6655c39f80fd.tar.gz
flowbox: Set accessible roles
Use the GRID and GRID_CELL roles for GtkFlowBox and GtkFlowBoxChild.
-rw-r--r--docs/reference/gtk/section-accessibility.md2
-rw-r--r--gtk/gtkenums.h4
-rw-r--r--gtk/gtkflowbox.c2
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