[gtk/a11y/atspi] listbox: Set accessible roles
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/a11y/atspi] listbox: Set accessible roles
- Date: Thu, 15 Oct 2020 02:27:59 +0000 (UTC)
commit 147868a30c61c45f1ef0d073a09db18f15d12bd9
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Oct 14 22:16:00 2020 -0400
listbox: Set accessible roles
Use the LIST and LIST_ITEM roles for GtkListBox
and GtkListBoxRow.
docs/reference/gtk/section-accessibility.md | 2 ++
gtk/gtkenums.h | 6 +++---
gtk/gtklistbox.c | 2 ++
3 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/docs/reference/gtk/section-accessibility.md b/docs/reference/gtk/section-accessibility.md
index ade43a1bfa..01adae2898 100644
--- a/docs/reference/gtk/section-accessibility.md
+++ b/docs/reference/gtk/section-accessibility.md
@@ -51,6 +51,8 @@ Each role name is part of the #GtkAccessibleRole enumeration.
| `DIALOG` | A dialog that prompts the user to enter information or require a response | #GtkDialog and
subclasses |
| `IMG` | An image | #GtkImage, #GtkPicture |
| `LABEL` | A visible name or caption for a user interface component | #GtkLabel |
+| `LIST` | A list of items | #GtkListBox |
+| `LIST_ITEM` | An item in a list | #GtkListBoxRow |
| `METER` | Represents a value within a known range | #GtkLevelBar |
| `PROGRESS_BAR` | An element that display progress | #GtkProgressBar |
| `RADIO` | A checkable input in a group of radio roles | #GtkCheckButton |
diff --git a/gtk/gtkenums.h b/gtk/gtkenums.h
index d1ca41cb1a..b33f29ba82 100644
--- a/gtk/gtkenums.h
+++ b/gtk/gtkenums.h
@@ -1185,9 +1185,9 @@ typedef enum {
* @GTK_ACCESSIBLE_ROLE_LANDMARK: Unused
* @GTK_ACCESSIBLE_ROLE_LEGEND: Unused
* @GTK_ACCESSIBLE_ROLE_LINK: Unused
- * @GTK_ACCESSIBLE_ROLE_LIST: Unused
- * @GTK_ACCESSIBLE_ROLE_LIST_BOX: Unused
- * @GTK_ACCESSIBLE_ROLE_LIST_ITEM: Unused
+ * @GTK_ACCESSIBLE_ROLE_LIST: A list of items.
+ * @GTK_ACCESSIBLE_ROLE_LIST_BOX: Unused.
+ * @GTK_ACCESSIBLE_ROLE_LIST_ITEM: An item in a list.
* @GTK_ACCESSIBLE_ROLE_LOG: Unused
* @GTK_ACCESSIBLE_ROLE_MAIN: Unused
* @GTK_ACCESSIBLE_ROLE_MARQUEE: Unused
diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c
index ac1a28426e..189a68ea79 100644
--- a/gtk/gtklistbox.c
+++ b/gtk/gtklistbox.c
@@ -679,6 +679,7 @@ gtk_list_box_class_init (GtkListBoxClass *klass)
NULL);
gtk_widget_class_set_css_name (widget_class, I_("list"));
+ gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_LIST);
}
static void
@@ -3510,6 +3511,7 @@ gtk_list_box_row_class_init (GtkListBoxRowClass *klass)
gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
gtk_widget_class_set_css_name (widget_class, I_("row"));
+ gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_LIST_ITEM);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]