From 6f9013297a973159ab422a68733eea5ee41b26b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tyrychtr?= Date: Thu, 21 Apr 2022 17:55:39 +0200 Subject: [PATCH 1/3] Make the presentation of the stack sidebar listbox nicer for A11Y This fixes #4577. --- gtk/gtkstacksidebar.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gtk/gtkstacksidebar.c b/gtk/gtkstacksidebar.c index 49d26de430..0e84f52c11 100644 --- a/gtk/gtkstacksidebar.c +++ b/gtk/gtkstacksidebar.c @@ -148,6 +148,10 @@ gtk_stack_sidebar_init (GtkStackSidebar *self) self->list = GTK_LIST_BOX (gtk_list_box_new ()); gtk_widget_add_css_class (GTK_WIDGET (self->list), "navigation-sidebar"); + gtk_accessible_update_property (GTK_ACCESSIBLE (self->list), + GTK_ACCESSIBLE_PROPERTY_LABEL, "Sidebar", + -1); + gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), GTK_WIDGET (self->list)); From 6f01d458d539797615513f45f0e71c0c8a0c45d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tyrychtr?= Date: Fri, 22 Apr 2022 11:42:32 +0200 Subject: [PATCH 2/3] Localize the a11y label --- gtk/gtkstacksidebar.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gtk/gtkstacksidebar.c b/gtk/gtkstacksidebar.c index 0e84f52c11..e65e1ca7c5 100644 --- a/gtk/gtkstacksidebar.c +++ b/gtk/gtkstacksidebar.c @@ -34,6 +34,8 @@ #include "gtkwidgetprivate.h" #include "gtkintl.h" +#include + /** * GtkStackSidebar: * @@ -149,7 +151,8 @@ gtk_stack_sidebar_init (GtkStackSidebar *self) self->list = GTK_LIST_BOX (gtk_list_box_new ()); gtk_widget_add_css_class (GTK_WIDGET (self->list), "navigation-sidebar"); gtk_accessible_update_property (GTK_ACCESSIBLE (self->list), - GTK_ACCESSIBLE_PROPERTY_LABEL, "Sidebar", + GTK_ACCESSIBLE_PROPERTY_LABEL, + NC_("accessibility", "Sidebar"), -1); From 4ab9592924d056281e0a293fdc88b8892d8c69dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Tyrychtr?= Date: Mon, 25 Apr 2022 14:21:40 +0200 Subject: [PATCH 3/3] Use the correct macro --- gtk/gtkstacksidebar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtk/gtkstacksidebar.c b/gtk/gtkstacksidebar.c index e65e1ca7c5..9d73e9c270 100644 --- a/gtk/gtkstacksidebar.c +++ b/gtk/gtkstacksidebar.c @@ -152,7 +152,7 @@ gtk_stack_sidebar_init (GtkStackSidebar *self) gtk_widget_add_css_class (GTK_WIDGET (self->list), "navigation-sidebar"); gtk_accessible_update_property (GTK_ACCESSIBLE (self->list), GTK_ACCESSIBLE_PROPERTY_LABEL, - NC_("accessibility", "Sidebar"), + C_("accessibility", "Sidebar"), -1);