mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 14:31:10 +00:00
a11y: Tweak name and description computation
Instead of falling back to the role nick for both, fall back to the class name for the name, and to the empty string for the description. This makes labels show up in Accerciser the same way they did in GTK 3, and seems more useful to me than the alternative.
This commit is contained in:
parent
77d1026c5a
commit
dfc7d26275
@ -805,11 +805,8 @@ gtk_at_context_get_name_accumulate (GtkATContext *self,
|
|||||||
if (names->len != 0)
|
if (names->len != 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
GEnumClass *enum_class = g_type_class_peek (GTK_TYPE_ACCESSIBLE_ROLE);
|
if (self->accessible)
|
||||||
GEnumValue *enum_value = g_enum_get_value (enum_class, role);
|
g_ptr_array_add (names, (char *)G_OBJECT_TYPE_NAME (self->accessible));
|
||||||
|
|
||||||
if (enum_value != NULL)
|
|
||||||
g_ptr_array_add (names, (char *) enum_value->value_nick);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -871,8 +868,8 @@ gtk_at_context_get_description_accumulate (GtkATContext *self,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If there is no label or labelled-by attribute, hidden elements
|
/* If there is no description or described-by attribute, hidden elements
|
||||||
* have no name
|
* have no description
|
||||||
*/
|
*/
|
||||||
if (gtk_accessible_attribute_set_contains (self->states, GTK_ACCESSIBLE_STATE_HIDDEN))
|
if (gtk_accessible_attribute_set_contains (self->states, GTK_ACCESSIBLE_STATE_HIDDEN))
|
||||||
{
|
{
|
||||||
@ -881,16 +878,6 @@ gtk_at_context_get_description_accumulate (GtkATContext *self,
|
|||||||
if (gtk_boolean_accessible_value_get (value))
|
if (gtk_boolean_accessible_value_get (value))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This fallback is in place only for unlabelled elements */
|
|
||||||
if (labels->len != 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
GEnumClass *enum_class = g_type_class_peek (GTK_TYPE_ACCESSIBLE_ROLE);
|
|
||||||
GEnumValue *enum_value = g_enum_get_value (enum_class, role);
|
|
||||||
|
|
||||||
if (enum_value != NULL)
|
|
||||||
g_ptr_array_add (labels, (char *) enum_value->value_nick);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*< private >
|
/*< private >
|
||||||
|
Loading…
Reference in New Issue
Block a user