mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-13 14:00:09 +00:00
levelbar: Hide internal structure from a11y
According to section 7.1 of WAI-ARIA, the meter role has the "Children presentational" characteristic, which indicates that children should not be represented in the a11y tree.
This commit is contained in:
parent
ca9b06878d
commit
14a64c7372
@ -540,7 +540,9 @@ update_block_nodes (GtkLevelBar *self)
|
|||||||
self->block_widget = g_renew (GtkWidget*, self->block_widget, n_blocks);
|
self->block_widget = g_renew (GtkWidget*, self->block_widget, n_blocks);
|
||||||
for (i = self->n_blocks; i < n_blocks; i++)
|
for (i = self->n_blocks; i < n_blocks; i++)
|
||||||
{
|
{
|
||||||
self->block_widget[i] = gtk_gizmo_new ("block", NULL, NULL, NULL, NULL, NULL, NULL);
|
self->block_widget[i] = gtk_gizmo_new_with_role ("block",
|
||||||
|
GTK_ACCESSIBLE_ROLE_NONE,
|
||||||
|
NULL, NULL, NULL, NULL, NULL, NULL);
|
||||||
gtk_widget_insert_before (self->block_widget[i], GTK_WIDGET (self->trough_widget), NULL);
|
gtk_widget_insert_before (self->block_widget[i], GTK_WIDGET (self->trough_widget), NULL);
|
||||||
}
|
}
|
||||||
self->n_blocks = n_blocks;
|
self->n_blocks = n_blocks;
|
||||||
@ -1024,12 +1026,13 @@ gtk_level_bar_init (GtkLevelBar *self)
|
|||||||
|
|
||||||
self->inverted = FALSE;
|
self->inverted = FALSE;
|
||||||
|
|
||||||
self->trough_widget = gtk_gizmo_new ("trough",
|
self->trough_widget = gtk_gizmo_new_with_role ("trough",
|
||||||
gtk_level_bar_measure_trough,
|
GTK_ACCESSIBLE_ROLE_NONE,
|
||||||
gtk_level_bar_allocate_trough,
|
gtk_level_bar_measure_trough,
|
||||||
gtk_level_bar_render_trough,
|
gtk_level_bar_allocate_trough,
|
||||||
NULL,
|
gtk_level_bar_render_trough,
|
||||||
NULL, NULL);
|
NULL,
|
||||||
|
NULL, NULL);
|
||||||
gtk_widget_set_parent (self->trough_widget, GTK_WIDGET (self));
|
gtk_widget_set_parent (self->trough_widget, GTK_WIDGET (self));
|
||||||
|
|
||||||
gtk_level_bar_ensure_offset (self, GTK_LEVEL_BAR_OFFSET_LOW, 0.25);
|
gtk_level_bar_ensure_offset (self, GTK_LEVEL_BAR_OFFSET_LOW, 0.25);
|
||||||
|
Loading…
Reference in New Issue
Block a user