Compare commits

...

1 Commits

Author SHA1 Message Date
Corey Berla
cbc0a1b95a gtklistitem: a11y use the child label
a11y software uses the GtkListItemWidget for the label, but it's
private.  Whether the ListItemWidget has one or multiple children,
it can only have a single label.  Set LABELLED_BY to the child
of the ListItemWidget

See: https://gitlab.gnome.org/GNOME/nautilus/-/issues/2460
2022-11-24 17:14:20 -08:00
2 changed files with 11 additions and 1 deletions

View File

@@ -19,6 +19,7 @@
#include "config.h"
#include "gtkaccessible.h"
#include "gtklistitemprivate.h"
@@ -320,7 +321,13 @@ gtk_list_item_set_child (GtkListItem *self,
self->child = child;
if (self->owner)
gtk_list_item_widget_add_child (self->owner, child);
{
gtk_list_item_widget_add_child (self->owner, child);
gtk_accessible_update_relation (GTK_ACCESSIBLE (self->owner),
GTK_ACCESSIBLE_RELATION_LABELLED_BY, child, NULL,
-1);
}
}
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_ITEM]);

View File

@@ -689,6 +689,9 @@ gtk_list_item_widget_add_child (GtkListItemWidget *self,
GtkWidget *child)
{
gtk_widget_set_parent (child, GTK_WIDGET (self));
gtk_accessible_update_relation (GTK_ACCESSIBLE (self),
GTK_ACCESSIBLE_RELATION_LABELLED_BY, child, NULL,
-1);
}
void