a11y: Add roles to various widgets

This commit is contained in:
Emmanuele Bassi 2020-07-13 16:03:27 +01:00
parent da1ce01a6f
commit 58628f9a9e
6 changed files with 8 additions and 0 deletions

View File

@ -302,6 +302,8 @@ gtk_button_class_init (GtkButtonClass *klass)
"activate", NULL);
gtk_widget_class_add_binding_signal (widget_class, GDK_KEY_KP_Enter, 0,
"activate", NULL);
gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_BUTTON);
}
static void

View File

@ -201,6 +201,7 @@ gtk_check_button_class_init (GtkCheckButtonClass *class)
gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BOX_LAYOUT);
gtk_widget_class_set_css_name (widget_class, I_("checkbutton"));
gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_CHECKBOX);
}
static void

View File

@ -553,6 +553,8 @@ gtk_dialog_class_init (GtkDialogClass *class)
gtk_widget_class_bind_template_child_internal_private (widget_class, GtkDialog, action_area);
gtk_widget_class_bind_template_child_internal_private (widget_class, GtkDialog, content_area);
gtk_widget_class_bind_template_child_private (widget_class, GtkDialog, action_box);
gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_DIALOG);
}
static void

View File

@ -250,6 +250,7 @@ gtk_progress_bar_class_init (GtkProgressBarClass *class)
gtk_widget_class_set_css_name (widget_class, I_("progressbar"));
gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BOX_LAYOUT);
gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_PROGRESS_BAR);
}
static void

View File

@ -229,6 +229,7 @@ gtk_radio_button_class_init (GtkRadioButtonClass *class)
G_TYPE_NONE, 0);
gtk_widget_class_set_css_name (widget_class, I_("radiobutton"));
gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_RADIO);
}
static void

View File

@ -205,6 +205,7 @@ gtk_scrollbar_class_init (GtkScrollbarClass *class)
gtk_widget_class_set_css_name (widget_class, I_("scrollbar"));
gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BOX_LAYOUT);
gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_SCROLLBAR);
}
static void