If the anchor is below the expanded item, the expanded item will
go out of view if there are sufficient children items. This is not
ideal, so make sure to scroll to the item to ensure it remains in
view.
GVariant *parameter)
{
GtkTreeExpander *self = GTK_TREE_EXPANDER (widget);
+ gboolean expand;
if (self->list_row == NULL)
return;
- gtk_tree_list_row_set_expanded (self->list_row, !gtk_tree_list_row_get_expanded (self->list_row));
+ expand = !gtk_tree_list_row_get_expanded (self->list_row);
+
+ if (expand)
+ gtk_widget_activate_action (widget, "listitem.scroll-to", NULL);
+
+ gtk_tree_list_row_set_expanded (self->list_row, expand);
}
static gboolean