mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 22:41:43 +00:00
atcontext: Change the way we handle fallback
The tooltip text should only be considered after all other means are exhausted. but it can be used for both the name and the description. See https://www.w3.org/TR/accname-1.2/
This commit is contained in:
parent
22548785b0
commit
79847f20c4
@ -1075,6 +1075,15 @@ gtk_at_context_get_name_accumulate (GtkATContext *self,
|
||||
return;
|
||||
}
|
||||
|
||||
if (names->len == 0)
|
||||
{
|
||||
if (GTK_IS_WIDGET (self->accessible))
|
||||
{
|
||||
const char *tooltip = gtk_widget_get_tooltip_text (GTK_WIDGET (self->accessible));
|
||||
if (tooltip)
|
||||
g_ptr_array_add (names, (char *) tooltip);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@ -1148,6 +1157,16 @@ gtk_at_context_get_description_accumulate (GtkATContext *self,
|
||||
if (gtk_boolean_accessible_value_get (value))
|
||||
return;
|
||||
}
|
||||
|
||||
if (labels->len == 0)
|
||||
{
|
||||
if (GTK_IS_WIDGET (self->accessible))
|
||||
{
|
||||
const char *tooltip = gtk_widget_get_tooltip_text (GTK_WIDGET (self->accessible));
|
||||
if (tooltip)
|
||||
g_ptr_array_add (labels, (char *) tooltip);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static GtkAccessibleRole name_forbidden[] = {
|
||||
|
@ -9917,10 +9917,6 @@ gtk_widget_set_tooltip_text (GtkWidget *widget,
|
||||
priv->tooltip_text = tooltip_text;
|
||||
priv->tooltip_markup = tooltip_markup;
|
||||
|
||||
gtk_accessible_update_property (GTK_ACCESSIBLE (widget),
|
||||
GTK_ACCESSIBLE_PROPERTY_DESCRIPTION, priv->tooltip_text,
|
||||
-1);
|
||||
|
||||
gtk_widget_set_has_tooltip (widget, priv->tooltip_text != NULL);
|
||||
if (_gtk_widget_get_visible (widget))
|
||||
gtk_widget_trigger_tooltip_query (widget);
|
||||
|
Loading…
Reference in New Issue
Block a user