diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2021-04-21 11:14:28 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2021-04-21 11:43:11 +0100 |
commit | 57cc2c4918724dda03b9812ba13ed703ab660c04 (patch) | |
tree | 8c9787cc0adab54d9c7a2441c5b8db3f4be2482f | |
parent | 8f9145109b1ae44f6a3c7a948b95bed8d9c203bd (diff) | |
download | gtk+-57cc2c4918724dda03b9812ba13ed703ab660c04.tar.gz |
a11y: Set state on the GtkTreeExpander widget
Instead of setting it on its internal child.
-rw-r--r-- | gtk/gtktreeexpander.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/gtk/gtktreeexpander.c b/gtk/gtktreeexpander.c index 8bad1f5e5b..fb23f6433d 100644 --- a/gtk/gtktreeexpander.c +++ b/gtk/gtktreeexpander.c @@ -151,6 +151,8 @@ gtk_tree_expander_update_for_list_row (GtkTreeExpander *self) gtk_widget_unparent (child); } self->expander = NULL; + + gtk_accessible_reset_state (GTK_ACCESSIBLE (self), GTK_ACCESSIBLE_STATE_EXPANDED); } else { @@ -192,26 +194,27 @@ gtk_tree_expander_update_for_list_row (GtkTreeExpander *self) gtk_accessible_update_property (GTK_ACCESSIBLE (self->expander), GTK_ACCESSIBLE_PROPERTY_LABEL, _("Expand"), -1); - gtk_accessible_update_relation (GTK_ACCESSIBLE (self->expander), - GTK_ACCESSIBLE_RELATION_LABELLED_BY, self->child, NULL, - -1); } if (gtk_tree_list_row_get_expanded (self->list_row)) { gtk_widget_set_state_flags (self->expander, GTK_STATE_FLAG_CHECKED, FALSE); - gtk_accessible_update_state (GTK_ACCESSIBLE (self->expander), + gtk_accessible_update_state (GTK_ACCESSIBLE (self), GTK_ACCESSIBLE_STATE_EXPANDED, TRUE, -1); } else { gtk_widget_unset_state_flags (self->expander, GTK_STATE_FLAG_CHECKED); - gtk_accessible_update_state (GTK_ACCESSIBLE (self->expander), + gtk_accessible_update_state (GTK_ACCESSIBLE (self), GTK_ACCESSIBLE_STATE_EXPANDED, FALSE, -1); } + gtk_accessible_update_relation (GTK_ACCESSIBLE (self), + GTK_ACCESSIBLE_RELATION_LABELLED_BY, self->child, NULL, + -1); + child = gtk_widget_get_prev_sibling (self->expander); } else |