Skip to content

Commit dca519d

Browse files
committed
remove is_collapsed argument from tree_view::provider
1 parent 4096103 commit dca519d

File tree

3 files changed

+4
-15
lines changed

3 files changed

+4
-15
lines changed

src/ruis/widget/group/tree_view.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,18 +415,16 @@ utki::shared_ref<widget> tree_view::provider::get_widget(size_t index)
415415

416416
return this->get_widget(
417417
utki::make_span(path), //
418-
is_collapsed,
419418
std::move(prefix_widgets)
420419
);
421420
}
422421

423422
utki::shared_ref<widget> tree_view::provider::get_widget(
424423
utki::span<const size_t> index, //
425-
bool is_collapsed,
426424
widget_list prefix_widgets
427425
)
428426
{
429-
prefix_widgets.emplace_back(this->get_widget(index, is_collapsed));
427+
prefix_widgets.emplace_back(this->get_widget(index));
430428

431429
return make::row(
432430
this->context, //

src/ruis/widget/group/tree_view.hpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,28 +118,22 @@ class tree_view :
118118
* @brief Create item widget.
119119
* The tree_view will call this function when it needs an item widget for the given index.
120120
* @param index - index into the data model to create an item widget for.
121-
* @param is_collapsed - whether the item is collapsed or not.
122121
* @param prefix_widgets - a list of tree_view specific widgets, i.e. colapse/expande button and path indicators.
123122
* To be placed inside of a row.
124123
* @return The item widget.
125124
*/
126125
virtual utki::shared_ref<widget> get_widget(
127126
utki::span<const size_t> index, //
128-
bool is_collapsed,
129127
widget_list prefix_widgets
130128
);
131129

132130
/**
133131
* @brief Create item widget.
134-
* This function is called by the get_widghet(index, is_collapsed, prefix_widgets) overload.
132+
* This function is called by the get_widghet(index, prefix_widgets) overload.
135133
* @param index - index into the data model to create an item widget for.
136-
* @param is_collapsed - whether the item is collapsed or not.
137134
* @return The item widget.
138135
*/
139-
virtual utki::shared_ref<widget> get_widget(
140-
utki::span<const size_t> index, //
141-
bool is_collapsed // TODO: is this argument needed?
142-
) = 0;
136+
virtual utki::shared_ref<widget> get_widget(utki::span<const size_t> index) = 0;
143137

144138
/**
145139
* @brief Recycle item widget.

tests/app/src/tree_view_window.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,7 @@ class tree_view_items_provider : public ruis::tree_view::provider{
138138
this->selected_item.pop_back();
139139
}
140140

141-
utki::shared_ref<ruis::widget> get_widget(
142-
utki::span<const size_t> path, //
143-
bool is_collapsed
144-
)override{
141+
utki::shared_ref<ruis::widget> get_widget(utki::span<const size_t> path)override{
145142
ASSERT(!path.empty())
146143

147144
auto list = &this->root;

0 commit comments

Comments
 (0)