From 8bbc143ed185f6c584a8115dca5606832624684a Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 22 Jun 2023 18:36:39 -0400 Subject: [PATCH 1/2] scalebutton: Use the group role This is needed for accessible labels to work. --- gtk/gtkscalebutton.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gtk/gtkscalebutton.c b/gtk/gtkscalebutton.c index 4b7617a479..25a558a21f 100644 --- a/gtk/gtkscalebutton.c +++ b/gtk/gtkscalebutton.c @@ -374,6 +374,7 @@ gtk_scale_button_class_init (GtkScaleButtonClass *klass) gtk_widget_class_bind_template_callback (widget_class, cb_popup_mapped); gtk_widget_class_set_css_name (widget_class, I_("scalebutton")); + gtk_widget_class_set_accessible_role (widget_class, GTK_ACCESSIBLE_ROLE_GROUP); } static gboolean From 318cf132e9def97be8360d4013e54658028f29bc Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 22 Jun 2023 18:37:10 -0400 Subject: [PATCH 2/2] a11y: Extend the nested button hack to volume buttons --- gtk/gtkatcontext.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gtk/gtkatcontext.c b/gtk/gtkatcontext.c index de217117c2..3ca70f7b73 100644 --- a/gtk/gtkatcontext.c +++ b/gtk/gtkatcontext.c @@ -46,6 +46,7 @@ #include "gtkdropdown.h" #include "gtkcolordialogbutton.h" #include "gtkfontdialogbutton.h" +#include "gtkscalebutton.h" #include "print/gtkprinteroptionwidgetprivate.h" #if defined(GDK_WINDOWING_X11) || defined(GDK_WINDOWING_WAYLAND) @@ -1166,7 +1167,8 @@ is_nested_button (GtkATContext *self) if ((GTK_IS_TOGGLE_BUTTON (widget) && GTK_IS_DROP_DOWN (parent)) || (GTK_IS_TOGGLE_BUTTON (widget) && GTK_IS_MENU_BUTTON (parent)) || (GTK_IS_BUTTON (widget) && GTK_IS_COLOR_DIALOG_BUTTON (parent)) || - (GTK_IS_BUTTON (widget) && GTK_IS_FONT_DIALOG_BUTTON (parent)) + (GTK_IS_BUTTON (widget) && GTK_IS_FONT_DIALOG_BUTTON (parent)) || + (GTK_IS_BUTTON (widget) && GTK_IS_SCALE_BUTTON (parent)) #ifdef G_OS_UNIX || (GTK_IS_PRINTER_OPTION_WIDGET (parent) && (GTK_IS_CHECK_BUTTON (widget) ||