From 5ec0b07bafaa0d874fb2e7e0674e46f9d8f8378d Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 17 Jun 2023 22:38:43 -0400 Subject: [PATCH] dropdown: Shuffle accessible roles around Make the internal toggle button generic, so that the a11y checker doesn't complain about it not having a label. And mark the icons in the popup as presentational. --- gtk/gtkdropdown.c | 5 ++++- gtk/ui/gtkdropdown.ui | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gtk/gtkdropdown.c b/gtk/gtkdropdown.c index fd07bb1bf2..105c0817f8 100644 --- a/gtk/gtkdropdown.c +++ b/gtk/gtkdropdown.c @@ -695,7 +695,10 @@ setup_item (GtkSignalListItemFactory *factory, label = gtk_label_new (NULL); gtk_label_set_xalign (GTK_LABEL (label), 0.0); gtk_box_append (GTK_BOX (box), label); - icon = gtk_image_new_from_icon_name ("object-select-symbolic"); + icon = g_object_new (GTK_TYPE_IMAGE, + "icon-name", "object-select-symbolic", + "accessible-role", GTK_ACCESSIBLE_ROLE_NONE, + NULL); gtk_box_append (GTK_BOX (box), icon); gtk_list_item_set_child (list_item, box); } diff --git a/gtk/ui/gtkdropdown.ui b/gtk/ui/gtkdropdown.ui index cf86ccfede..7fc72f2ddc 100644 --- a/gtk/ui/gtkdropdown.ui +++ b/gtk/ui/gtkdropdown.ui @@ -3,6 +3,7 @@