dropdown: Shuffle accessible roles around
authorMatthias Clasen <mclasen@redhat.com>
Sun, 18 Jun 2023 02:38:43 +0000 (22:38 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 18 Jun 2023 02:40:17 +0000 (22:40 -0400)
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
gtk/ui/gtkdropdown.ui

index fd07bb1bf2c4f7cd123e01ffe5a20f7adcb9ab88..105c0817f88b9d1bd5b8dab17992a13755419ff5 100644 (file)
@@ -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);
 }
index cf86ccfede7730019953a31697093a2f1566b7e6..7fc72f2ddc5425cfac263227cd2dad375ec08658 100644 (file)
@@ -3,6 +3,7 @@
   <template class="GtkDropDown" parent="GtkWidget">
     <child>
       <object class="GtkToggleButton" id="button">
+        <property name="accessible-role">generic</property>
         <signal name="toggled" handler="button_toggled"/>
         <child>
           <object class="GtkBox">