mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-12-16 01:48:56 +08:00
Add Merge() specializations to support more Element containers (#1117)
`Merge()` was previously only supporting `Elements` as a `Element` container. This PR adds specialization for: - all the containers that matches the concept `std::ranges::range` - `std::queue` - `std::stack` Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com> Bug:https://github.com/ArthurSonzogni/FTXUI/issues/1108 Fixed:https://github.com/ArthurSonzogni/FTXUI/issues/1108
This commit is contained in:
@@ -173,7 +173,7 @@ class InputBase : public ComponentBase, public InputOption {
|
||||
elements.push_back(element);
|
||||
}
|
||||
|
||||
auto element = vbox(std::move(elements), cursor_line) | frame;
|
||||
auto element = vbox(std::move(elements)) | frame;
|
||||
return transform_func({
|
||||
std::move(element), hovered_, is_focused,
|
||||
false // placeholder
|
||||
|
||||
@@ -145,8 +145,8 @@ class MenuBase : public ComponentBase, public MenuOption {
|
||||
}
|
||||
|
||||
const Element bar = IsHorizontal()
|
||||
? hbox(std::move(elements), selected_focus_)
|
||||
: vbox(std::move(elements), selected_focus_);
|
||||
? hbox(std::move(elements))
|
||||
: vbox(std::move(elements));
|
||||
|
||||
if (!underline.enabled) {
|
||||
return bar | reflect(box_);
|
||||
|
||||
@@ -46,7 +46,7 @@ class RadioboxBase : public ComponentBase, public RadioboxOption {
|
||||
}
|
||||
elements.push_back(element | reflect(boxes_[i]));
|
||||
}
|
||||
return vbox(std::move(elements), hovered_) | reflect(box_);
|
||||
return vbox(std::move(elements)) | reflect(box_);
|
||||
}
|
||||
|
||||
// NOLINTNEXTLINE(readability-function-cognitive-complexity)
|
||||
|
||||
Reference in New Issue
Block a user