mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 21:51:08 +00:00
a11y: Remove special handling of accessible names for static text widgets
By doing this, we gain the capability to send notifications when their accessible names change. Also, it simplifies the accessible name generation logic.
This commit is contained in:
parent
d16d2135e6
commit
d5b34aecdd
@ -1355,22 +1355,6 @@ gtk_at_context_get_text_accumulate (GtkATContext *self,
|
||||
}
|
||||
}
|
||||
|
||||
/* Step 2.G */
|
||||
if (GTK_IS_LABEL (self->accessible))
|
||||
{
|
||||
const char *text = gtk_label_get_text (GTK_LABEL (self->accessible));
|
||||
if (text && not_just_space (text))
|
||||
append_with_space (res, text);
|
||||
return;
|
||||
}
|
||||
else if (GTK_IS_INSCRIPTION (self->accessible))
|
||||
{
|
||||
const char *text = gtk_inscription_get_text (GTK_INSCRIPTION (self->accessible));
|
||||
if (text && not_just_space (text))
|
||||
append_with_space (res, text);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Step 2.I */
|
||||
if (GTK_IS_WIDGET (self->accessible))
|
||||
{
|
||||
|
@ -805,6 +805,11 @@ gtk_inscription_set_text (GtkInscription *self,
|
||||
gtk_widget_queue_draw (GTK_WIDGET (self));
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_TEXT]);
|
||||
|
||||
gtk_accessible_update_property (GTK_ACCESSIBLE (self),
|
||||
GTK_ACCESSIBLE_PROPERTY_LABEL,
|
||||
text,
|
||||
-1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3086,6 +3086,11 @@ gtk_label_set_label_internal (GtkLabel *self,
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (self), label_props[PROP_LABEL]);
|
||||
|
||||
gtk_accessible_update_property (GTK_ACCESSIBLE (self),
|
||||
GTK_ACCESSIBLE_PROPERTY_LABEL,
|
||||
self->label,
|
||||
-1);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user