Use the correct role for GtkToggleButton
authorLukáš Tyrychtr <ltyrycht@redhat.com>
Thu, 23 Feb 2023 14:02:29 +0000 (15:02 +0100)
committerLukáš Tyrychtr <ltyrycht@redhat.com>
Thu, 23 Feb 2023 14:02:29 +0000 (15:02 +0100)
gtk/gtktogglebutton.c

index d8c41d58dcf6177c5645bb030701a5e28b86acf0..72d305eb71dc90dd76be5b84506f73bd3b860eb5 100644 (file)
  * `GtkToggleButton` has a single CSS node with name button. To differentiate
  * it from a plain `GtkButton`, it gets the `.toggle` style class.
  *
+ * ## Accessibility
+ *
+ * `GtkToggleButton` uses the %GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON role.
+ *
  * ## Creating two `GtkToggleButton` widgets.
  *
  * ```c
@@ -311,6 +315,8 @@ gtk_toggle_button_class_init (GtkToggleButtonClass *class)
                   G_TYPE_NONE, 0);
 
   gtk_widget_class_set_css_name (widget_class, I_("button"));
+
+  gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_TOGGLE_BUTTON);
 }
 
 static void