@@ -344,15 +344,16 @@ utki::shared_ref<widget> tree_view::provider::get_widget(size_t index)
344
344
list = &n->children ;
345
345
}
346
346
347
- auto ret = ruis::make::row (this ->context , {});
347
+ widget_list prefix_widgets;
348
+ // auto ret = ruis::make::row(this->context, {});
348
349
349
350
ASSERT (is_last_item_in_parent.size () == path.size ())
350
351
351
352
for (unsigned i = 0 ; i != path.size () - 1 ; ++i) {
352
353
if (is_last_item_in_parent[i]) {
353
- ret. get () .push_back (make_empty_space_indent (this ->context ));
354
+ prefix_widgets .push_back (make_empty_space_indent (this ->context ));
354
355
} else {
355
- ret. get () .push_back (make_vertical_line_indent (this ->context ));
356
+ prefix_widgets .push_back (make_vertical_line_indent (this ->context ));
356
357
}
357
358
}
358
359
@@ -407,12 +408,31 @@ utki::shared_ref<widget> tree_view::provider::get_widget(size_t index)
407
408
};
408
409
widget.get ().push_back (w);
409
410
}
410
- ret. get () .push_back (widget);
411
+ prefix_widgets .push_back (widget);
411
412
}
412
413
413
- ret.get ().push_back (this ->get_widget (utki::make_span (path), is_collapsed));
414
+ // ret.get().push_back(this->get_widget(utki::make_span(path), is_collapsed));
414
415
415
- return ret;
416
+ return this ->get_widget (
417
+ utki::make_span (path), //
418
+ is_collapsed,
419
+ std::move (prefix_widgets)
420
+ );
421
+ }
422
+
423
+ utki::shared_ref<widget> tree_view::provider::get_widget (
424
+ utki::span<const size_t > index, //
425
+ bool is_collapsed,
426
+ widget_list prefix_widgets
427
+ )
428
+ {
429
+ prefix_widgets.push_back (this ->get_widget (index, is_collapsed));
430
+
431
+ return make::row (
432
+ this ->context , //
433
+ {},
434
+ std::move (prefix_widgets)
435
+ );
416
436
}
417
437
418
438
void tree_view::provider::recycle (size_t index, utki::shared_ref<widget> w)
0 commit comments