mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-29 02:38:10 +08:00
Refactor component containers.
This commit is contained in:
@@ -1,57 +1,53 @@
|
||||
#include "ftxui/component/component.hpp"
|
||||
#include "ftxui/component/delegate.hpp"
|
||||
#include <assert.h>
|
||||
|
||||
namespace ftxui {
|
||||
void Component::Detach() { if (!parent_) return; auto it = std::find(std::begin(parent_->children_),
|
||||
std::end(parent_->children_), this);
|
||||
parent_->children_.erase(it);
|
||||
|
||||
Component::Component(Delegate* delegate) {
|
||||
delegate_ = delegate;
|
||||
delegate_->Register(this);
|
||||
}
|
||||
|
||||
Component::~Component() {}
|
||||
void Component::Attach(Component* parent) {
|
||||
Detach();
|
||||
parent_ = parent;
|
||||
parent_->children_.push_back(this);
|
||||
}
|
||||
|
||||
Element Component::Render() {
|
||||
using namespace ftxui;
|
||||
return text(L"Not implemented component");
|
||||
void Component::Add(Component* child) {
|
||||
child->Attach(this);
|
||||
}
|
||||
|
||||
Component::~Component() {
|
||||
Detach();
|
||||
}
|
||||
|
||||
bool Component::OnEvent(Event event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Component::Focused() {
|
||||
Delegate* current = delegate_->Root();
|
||||
while (current) {
|
||||
if (current == delegate_)
|
||||
for(Component* child : children_) {
|
||||
if (child->OnEvent(event))
|
||||
return true;
|
||||
|
||||
Component* active_child = current->component()->GetActiveChild();
|
||||
current = active_child ? active_child->delegate_ : nullptr;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Component::Active() {
|
||||
Delegate* parent = delegate_->Parent();
|
||||
return parent && parent->component()->GetActiveChild() == this;
|
||||
Component* Component::ActiveChild() {
|
||||
return children_.empty() ? nullptr : children_.front();
|
||||
}
|
||||
|
||||
Component* Component::PreviousSibling() {
|
||||
Delegate* sibling = delegate_->PreviousSibling();
|
||||
return sibling ? sibling->component() : nullptr;
|
||||
Element Component::Render() {
|
||||
return text(L"Not implemented component");
|
||||
}
|
||||
|
||||
Component* Component::NextSibling() {
|
||||
Delegate* sibling = delegate_->NextSibling();
|
||||
return sibling ? sibling->component() : nullptr;
|
||||
}
|
||||
|
||||
Component* Component::Parent() {
|
||||
Delegate* parent_delegate = delegate_->Parent();
|
||||
if (!parent_delegate)
|
||||
return nullptr;
|
||||
return parent_delegate->component();
|
||||
bool Component::Focused() {
|
||||
Component* current = this;
|
||||
for(;;) {
|
||||
Component* parent = current->parent_;
|
||||
if (!parent)
|
||||
return true;
|
||||
if (parent->ActiveChild() != current)
|
||||
return false;
|
||||
current = parent;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ftxui
|
||||
|
@@ -1,30 +0,0 @@
|
||||
#include "ftxui/component/component_direction.hpp"
|
||||
|
||||
namespace ftxui {
|
||||
|
||||
ComponentDirection::ComponentDirection(Delegate* delegate)
|
||||
: Component(delegate), active_child_(nullptr) {}
|
||||
|
||||
bool ComponentDirection::OnEvent(Event event) {
|
||||
if (!Focused())
|
||||
return false;
|
||||
|
||||
if (!active_child_)
|
||||
return false;
|
||||
|
||||
if (active_child_->OnEvent(event))
|
||||
return true;
|
||||
|
||||
return HandleDirection(event);
|
||||
|
||||
}
|
||||
|
||||
Component* ComponentDirection::GetActiveChild() {
|
||||
return active_child_;
|
||||
}
|
||||
|
||||
void ComponentDirection::Focus(Component* child) {
|
||||
active_child_ = child;
|
||||
}
|
||||
|
||||
} // namespace ftxui::Component
|
@@ -1,30 +0,0 @@
|
||||
#include "ftxui/component/component_horizontal.hpp"
|
||||
|
||||
namespace ftxui {
|
||||
|
||||
ComponentHorizontal::ComponentHorizontal(Delegate* delegate)
|
||||
: ComponentDirection(delegate) {}
|
||||
|
||||
bool ComponentHorizontal::HandleDirection(Event event) {
|
||||
// Left pressed ?
|
||||
if (event == Event::ArrowLeft || event == Event::Character('h')) {
|
||||
Component* previous_sibling = active_child_->PreviousSibling();
|
||||
if (previous_sibling) {
|
||||
active_child_ = previous_sibling;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Left pressed ?
|
||||
if (event == Event::ArrowRight || event == Event::Character('l')) {
|
||||
Component* next_sibling = active_child_->NextSibling();
|
||||
if (next_sibling) {
|
||||
active_child_ = next_sibling;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace ftxui
|
@@ -1,30 +0,0 @@
|
||||
#include "ftxui/component/component_vertical.hpp"
|
||||
|
||||
namespace ftxui {
|
||||
|
||||
ComponentVertical::ComponentVertical(Delegate* delegate)
|
||||
: ComponentDirection(delegate) {}
|
||||
|
||||
bool ComponentVertical::HandleDirection(Event event) {
|
||||
// Up pressed ?
|
||||
if (event == Event::ArrowUp || event == Event::Character('k')) {
|
||||
Component* previous_sibling = active_child_->PreviousSibling();
|
||||
if (previous_sibling) {
|
||||
active_child_ = previous_sibling;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Down pressed ?
|
||||
if (event == Event::ArrowDown || event == Event::Character('j')) {
|
||||
Component* next_sibling = active_child_->NextSibling();
|
||||
if (next_sibling) {
|
||||
active_child_ = next_sibling;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace ftxui
|
73
ftxui/src/ftxui/component/container.cpp
Normal file
73
ftxui/src/ftxui/component/container.cpp
Normal file
@@ -0,0 +1,73 @@
|
||||
#include "ftxui/component/container.hpp"
|
||||
|
||||
namespace ftxui {
|
||||
|
||||
// static
|
||||
Container Container::Horizontal() {
|
||||
return Container(&Container::Horizontal);
|
||||
}
|
||||
|
||||
// static
|
||||
Container Container::Vertical() {
|
||||
return Container(&Container::Vertical);
|
||||
}
|
||||
|
||||
Container::Container(Container::Handler handler) : handler_(handler) {}
|
||||
|
||||
bool Container::OnEvent(Event event) {
|
||||
if (!Focused())
|
||||
return false;
|
||||
|
||||
if (ActiveChild()->OnEvent(event))
|
||||
return true;
|
||||
|
||||
return (this->*handler_)(event);
|
||||
}
|
||||
|
||||
Component* Container::ActiveChild() {
|
||||
return children_[selected_ % children_.size()];
|
||||
}
|
||||
|
||||
bool Container::Vertical(Event event) {
|
||||
selected_ %= children_.size();
|
||||
// Left pressed ?
|
||||
if (event == Event::ArrowUp || event == Event::Character('k')) {
|
||||
if (selected_ != 0) {
|
||||
selected_--;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Left pressed ?
|
||||
if (event == Event::ArrowDown || event == Event::Character('j')) {
|
||||
if (selected_ != children_.size() - 1) {
|
||||
selected_++;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Container::Horizontal(Event event) {
|
||||
selected_ %= children_.size();
|
||||
// Left pressed ?
|
||||
if (event == Event::ArrowLeft || event == Event::Character('h')) {
|
||||
if (selected_ != 0) {
|
||||
selected_--;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Left pressed ?
|
||||
if (event == Event::ArrowRight || event == Event::Character('l')) {
|
||||
if (selected_ != children_.size() - 1) {
|
||||
selected_++;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace ftxui
|
@@ -1,11 +1,8 @@
|
||||
#include "ftxui/component/input.hpp"
|
||||
#include "ftxui/util/string.hpp"
|
||||
#include "ftxui/screen/string.hpp"
|
||||
|
||||
namespace ftxui {
|
||||
|
||||
Input::Input(Delegate* delegate): Component(delegate) {}
|
||||
Input::~Input() {}
|
||||
|
||||
// Component implementation.
|
||||
Element Input::Render() {
|
||||
bool is_focused = Focused();
|
||||
|
@@ -4,8 +4,6 @@
|
||||
|
||||
namespace ftxui {
|
||||
|
||||
Menu::Menu(Delegate* delegate) : Component(delegate) {}
|
||||
|
||||
Element Menu::Render() {
|
||||
std::vector<Element> elements;
|
||||
bool focused = Focused();
|
||||
|
@@ -45,53 +45,10 @@ Event GetEvent() {
|
||||
|
||||
}; // namespace
|
||||
|
||||
class ScreenInteractive::Delegate : public Component::Delegate {
|
||||
public:
|
||||
Delegate() : root_(this) {}
|
||||
|
||||
void Register(Component* c) override { component_ = c; }
|
||||
|
||||
std::vector<std::unique_ptr<Delegate>> child_;
|
||||
Delegate* NewChild() override {
|
||||
Delegate* child = new Delegate;
|
||||
child->root_ = root_;
|
||||
child->parent_ = this;
|
||||
|
||||
if (!child_.empty()) {
|
||||
child_.back()->next_sibling_ = child;
|
||||
child->previous_sibling_ = child_.back().get();
|
||||
}
|
||||
|
||||
child_.emplace_back(child);
|
||||
return child;
|
||||
}
|
||||
|
||||
void OnEvent(Event event) { component_->OnEvent(event); }
|
||||
|
||||
std::vector<Component::Delegate*> children() override {
|
||||
std::vector<Component::Delegate*> ret;
|
||||
for (auto& it : child_)
|
||||
ret.push_back(it.get());
|
||||
return ret;
|
||||
}
|
||||
|
||||
Component::Delegate* root_;
|
||||
Component::Delegate* parent_ = nullptr;
|
||||
Component::Delegate* previous_sibling_ = nullptr;
|
||||
Component::Delegate* next_sibling_ = nullptr;
|
||||
Component* component_;
|
||||
|
||||
Component::Delegate* Root() override { return root_; }
|
||||
Component::Delegate* Parent() override { return parent_; }
|
||||
Component::Delegate* PreviousSibling() override { return previous_sibling_; }
|
||||
Component::Delegate* NextSibling() override { return next_sibling_; }
|
||||
Component* component() override { return component_; }
|
||||
};
|
||||
|
||||
ScreenInteractive::ScreenInteractive(size_t dimx,
|
||||
size_t dimy,
|
||||
Dimension dimension)
|
||||
: Screen(dimx, dimy), delegate_(new Delegate), dimension_(dimension) {}
|
||||
: Screen(dimx, dimy), dimension_(dimension) {}
|
||||
ScreenInteractive::~ScreenInteractive() {}
|
||||
|
||||
// static
|
||||
@@ -109,10 +66,10 @@ ScreenInteractive ScreenInteractive::TerminalOutput() {
|
||||
return ScreenInteractive(0, 0, Dimension::TerminalOutput);
|
||||
}
|
||||
|
||||
void ScreenInteractive::Loop() {
|
||||
std::cout << "\033[?9h"; /* Send Mouse Row & Column on Button Press */
|
||||
std::cout << "\033[?1000h"; /* Send Mouse X & Y on button press and release */
|
||||
std::cout << std::flush;
|
||||
void ScreenInteractive::Loop(Component* component) {
|
||||
//std::cout << "\033[?9h"; [> Send Mouse Row & Column on Button Press <]
|
||||
//std::cout << "\033[?1000h"; [> Send Mouse X & Y on button press and release <]
|
||||
//std::cout << std::flush;
|
||||
|
||||
// Save the old terminal configuration.
|
||||
struct termios terminal_configuration_old;
|
||||
@@ -130,23 +87,27 @@ void ScreenInteractive::Loop() {
|
||||
|
||||
std::string reset_position;
|
||||
while (!quit_) {
|
||||
PrepareDraw();
|
||||
Draw(component);
|
||||
std::cout << reset_position << ToString() << std::flush;
|
||||
reset_position = ResetPosition();
|
||||
Clear();
|
||||
delegate_->OnEvent(GetEvent());
|
||||
component->OnEvent(GetEvent());
|
||||
}
|
||||
|
||||
// Restore the old terminal configuration.
|
||||
tcsetattr(STDIN_FILENO, TCSANOW, &terminal_configuration_old);
|
||||
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
void ScreenInteractive::PrepareDraw() {
|
||||
auto document = delegate_->component()->Render();
|
||||
void ScreenInteractive::Draw(Component* component) {
|
||||
auto document = component->Render();
|
||||
size_t dimx;
|
||||
size_t dimy;
|
||||
switch (dimension_) {
|
||||
case Dimension::Fixed:
|
||||
dimx = dimx_;
|
||||
dimy = dimy_;
|
||||
break;
|
||||
case Dimension::TerminalOutput:
|
||||
document->ComputeRequirement();
|
||||
@@ -161,8 +122,10 @@ void ScreenInteractive::PrepareDraw() {
|
||||
}
|
||||
|
||||
if (dimx != dimx_ || dimy != dimy_) {
|
||||
std::cerr << dimx_ << " " << dimy_ << std::endl;
|
||||
dimx_ = dimx;
|
||||
dimy_ = dimy;
|
||||
std::cerr << dimx_ << " " << dimy_ << std::endl;
|
||||
pixels_ = std::vector<std::vector<Pixel>>(
|
||||
dimy, std::vector<Pixel>(dimx));
|
||||
}
|
||||
@@ -170,10 +133,6 @@ void ScreenInteractive::PrepareDraw() {
|
||||
Render(*this, document.get());
|
||||
}
|
||||
|
||||
Component::Delegate* ScreenInteractive::delegate() {
|
||||
return delegate_.get();
|
||||
}
|
||||
|
||||
std::function<void()> ScreenInteractive::ExitLoopClosure() {
|
||||
return [this]() { quit_ = true; };
|
||||
}
|
||||
|
@@ -2,13 +2,10 @@
|
||||
|
||||
namespace ftxui {
|
||||
|
||||
Toggle::Toggle(Delegate* delegate) : Component(delegate) {}
|
||||
|
||||
Element Toggle::Render() {
|
||||
auto highlight = Focused() ? inverted : bold;
|
||||
|
||||
Children children;
|
||||
|
||||
Elements children;
|
||||
for(size_t i = 0; i<options.size(); ++i) {
|
||||
// Separator.
|
||||
if (i != 0)
|
||||
|
@@ -5,7 +5,7 @@ namespace ftxui {
|
||||
|
||||
class Blink : public NodeDecorator {
|
||||
public:
|
||||
Blink(Children children) : NodeDecorator(std::move(children)) {}
|
||||
Blink(Elements children) : NodeDecorator(std::move(children)) {}
|
||||
~Blink() override {}
|
||||
|
||||
void Render(Screen& screen) override {
|
||||
@@ -18,7 +18,7 @@ class Blink : public NodeDecorator {
|
||||
}
|
||||
};
|
||||
|
||||
std::unique_ptr<Node> blink(Child child) {
|
||||
std::unique_ptr<Node> blink(Element child) {
|
||||
return std::make_unique<Blink>(unpack(std::move(child)));
|
||||
}
|
||||
|
||||
|
@@ -5,7 +5,7 @@ namespace ftxui {
|
||||
|
||||
class Bold : public NodeDecorator {
|
||||
public:
|
||||
Bold(Children children) : NodeDecorator(std::move(children)) {}
|
||||
Bold(Elements children) : NodeDecorator(std::move(children)) {}
|
||||
~Bold() override {}
|
||||
|
||||
void Render(Screen& screen) override {
|
||||
@@ -18,7 +18,7 @@ class Bold : public NodeDecorator {
|
||||
}
|
||||
};
|
||||
|
||||
std::unique_ptr<Node> bold(Child child) {
|
||||
std::unique_ptr<Node> bold(Element child) {
|
||||
return std::make_unique<Bold>(unpack(std::move(child)));
|
||||
}
|
||||
|
||||
|
@@ -5,7 +5,7 @@ namespace ftxui {
|
||||
|
||||
class BgColor : public NodeDecorator {
|
||||
public:
|
||||
BgColor(Children children, Color color)
|
||||
BgColor(Elements children, Color color)
|
||||
: NodeDecorator(std::move(children)), color_(color) {}
|
||||
|
||||
void Render(Screen& screen) override {
|
||||
@@ -22,7 +22,7 @@ class BgColor : public NodeDecorator {
|
||||
|
||||
class FgColor : public NodeDecorator {
|
||||
public:
|
||||
FgColor(Children children, Color color)
|
||||
FgColor(Elements children, Color color)
|
||||
: NodeDecorator(std::move(children)), color_(color) {}
|
||||
~FgColor() override {}
|
||||
|
||||
@@ -38,22 +38,22 @@ class FgColor : public NodeDecorator {
|
||||
Color color_;
|
||||
};
|
||||
|
||||
std::unique_ptr<Node> color(Color c, Child child) {
|
||||
std::unique_ptr<Node> color(Color c, Element child) {
|
||||
return std::make_unique<FgColor>(unpack(std::move(child)), c);
|
||||
}
|
||||
|
||||
std::unique_ptr<Node> bgcolor(Color c, Child child) {
|
||||
std::unique_ptr<Node> bgcolor(Color c, Element child) {
|
||||
return std::make_unique<BgColor>(unpack(std::move(child)), c);
|
||||
}
|
||||
|
||||
Decorator color(Color c) {
|
||||
return [c](Child child) {
|
||||
return [c](Element child) {
|
||||
return color(c, std::move(child));
|
||||
};
|
||||
}
|
||||
|
||||
Decorator bgcolor(Color c) {
|
||||
return [c](Child child) {
|
||||
return [c](Element child) {
|
||||
return bgcolor(c, std::move(child));
|
||||
};
|
||||
}
|
||||
|
@@ -5,7 +5,7 @@ namespace ftxui {
|
||||
|
||||
class DBox : public Node {
|
||||
public:
|
||||
DBox(Children children) : Node(std::move(children)) {}
|
||||
DBox(Elements children) : Node(std::move(children)) {}
|
||||
~DBox() {}
|
||||
|
||||
void ComputeRequirement() override {
|
||||
@@ -28,7 +28,7 @@ class DBox : public Node {
|
||||
}
|
||||
};
|
||||
|
||||
std::unique_ptr<Node> dbox(Children children) {
|
||||
std::unique_ptr<Node> dbox(Elements children) {
|
||||
return std::make_unique<DBox>(std::move(children));
|
||||
}
|
||||
|
||||
|
@@ -7,7 +7,7 @@ using ftxui::Screen;
|
||||
|
||||
class Dim : public NodeDecorator {
|
||||
public:
|
||||
Dim(Children children) : NodeDecorator(std::move(children)) {}
|
||||
Dim(Elements children) : NodeDecorator(std::move(children)) {}
|
||||
~Dim() override {}
|
||||
|
||||
void Render(Screen& screen) override {
|
||||
@@ -20,7 +20,7 @@ class Dim : public NodeDecorator {
|
||||
}
|
||||
};
|
||||
|
||||
std::unique_ptr<Node> dim(Child child) {
|
||||
std::unique_ptr<Node> dim(Element child) {
|
||||
return std::make_unique<Dim>(unpack(std::move(child)));
|
||||
}
|
||||
|
||||
|
@@ -9,7 +9,7 @@ static wchar_t charset[] = L"┌┐└┘─│┬┴┤├";
|
||||
|
||||
class Frame : public Node {
|
||||
public:
|
||||
Frame(Children children) : Node(std::move(children)) {}
|
||||
Frame(Elements children) : Node(std::move(children)) {}
|
||||
~Frame() override {}
|
||||
|
||||
void ComputeRequirement() override {
|
||||
@@ -81,16 +81,16 @@ class Frame : public Node {
|
||||
}
|
||||
};
|
||||
|
||||
std::unique_ptr<Node> frame(Child child) {
|
||||
std::unique_ptr<Node> frame(Element child) {
|
||||
return std::make_unique<Frame>(unpack(std::move(child)));
|
||||
}
|
||||
|
||||
std::unique_ptr<Node> window(Child title, Child content) {
|
||||
std::unique_ptr<Node> window(Element title, Element content) {
|
||||
return std::make_unique<Frame>(unpack(std::move(content), std::move(title)));
|
||||
}
|
||||
|
||||
Decorator boxed() {
|
||||
return [](Child child) {
|
||||
return [](Element child) {
|
||||
return frame(std::move(child));
|
||||
};
|
||||
}
|
||||
|
@@ -5,7 +5,7 @@ namespace ftxui {
|
||||
|
||||
class HBox : public Node {
|
||||
public:
|
||||
HBox(Children children) : Node(std::move(children)) {}
|
||||
HBox(Elements children) : Node(std::move(children)) {}
|
||||
~HBox() {}
|
||||
|
||||
void ComputeRequirement() override {
|
||||
@@ -59,7 +59,7 @@ class HBox : public Node {
|
||||
}
|
||||
};
|
||||
|
||||
std::unique_ptr<Node> hbox(Children children) {
|
||||
std::unique_ptr<Node> hbox(Elements children) {
|
||||
return std::make_unique<HBox>(std::move(children));
|
||||
}
|
||||
|
||||
|
@@ -7,7 +7,7 @@ using ftxui::Screen;
|
||||
|
||||
class Inverted : public NodeDecorator {
|
||||
public:
|
||||
Inverted(Children children) : NodeDecorator(std::move(children)) {}
|
||||
Inverted(Elements children) : NodeDecorator(std::move(children)) {}
|
||||
~Inverted() override {}
|
||||
|
||||
void Render(Screen& screen) override {
|
||||
@@ -20,7 +20,7 @@ class Inverted : public NodeDecorator {
|
||||
}
|
||||
};
|
||||
|
||||
std::unique_ptr<Node> inverted(Child child) {
|
||||
std::unique_ptr<Node> inverted(Element child) {
|
||||
return std::make_unique<Inverted>(unpack(std::move(child)));
|
||||
}
|
||||
|
||||
|
@@ -9,7 +9,7 @@ namespace ftxui {
|
||||
// Helper class.
|
||||
class NodeDecorator : public Node {
|
||||
public:
|
||||
NodeDecorator(Children children) : Node(std::move(children)) {}
|
||||
NodeDecorator(Elements children) : Node(std::move(children)) {}
|
||||
~NodeDecorator() override {}
|
||||
void ComputeRequirement() override;
|
||||
void SetBox(Box box) override;
|
||||
|
@@ -7,7 +7,7 @@ using ftxui::Screen;
|
||||
|
||||
class Underlined : public NodeDecorator {
|
||||
public:
|
||||
Underlined(Children children) : NodeDecorator(std::move(children)) {}
|
||||
Underlined(Elements children) : NodeDecorator(std::move(children)) {}
|
||||
~Underlined() override {}
|
||||
|
||||
void Render(Screen& screen) override {
|
||||
@@ -20,7 +20,7 @@ class Underlined : public NodeDecorator {
|
||||
}
|
||||
};
|
||||
|
||||
std::unique_ptr<Node> underlined(Child child) {
|
||||
std::unique_ptr<Node> underlined(Element child) {
|
||||
return std::make_unique<Underlined>(unpack(std::move(child)));
|
||||
}
|
||||
|
||||
|
@@ -5,7 +5,7 @@ namespace ftxui {
|
||||
|
||||
class VBox : public Node {
|
||||
public:
|
||||
VBox(Children children) : Node(std::move(children)) {}
|
||||
VBox(Elements children) : Node(std::move(children)) {}
|
||||
~VBox() {}
|
||||
|
||||
void ComputeRequirement() {
|
||||
@@ -59,7 +59,7 @@ class VBox : public Node {
|
||||
}
|
||||
};
|
||||
|
||||
std::unique_ptr<Node> vbox(Children children) {
|
||||
std::unique_ptr<Node> vbox(Elements children) {
|
||||
return std::make_unique<VBox>(std::move(children));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user