FTXUI/src/ftxui/dom/composite_decorator.cpp

27 lines
660 B
C++
Raw Normal View History

2020-04-20 03:00:37 +08:00
// Copyright 2020 Arthur Sonzogni. All rights reserved.
// Use of this source code is governed by the MIT license that can be found in
// the LICENSE file.
#include "ftxui/dom/elements.hpp"
2020-03-23 05:32:44 +08:00
#include "ftxui/dom/node.hpp"
2018-09-20 03:52:25 +08:00
namespace ftxui {
2018-09-20 03:52:25 +08:00
std::unique_ptr<Node> hcenter(Element child) {
return hbox(filler(), std::move(child), filler());
2018-09-20 03:52:25 +08:00
}
std::unique_ptr<Node> vcenter(Element child) {
return vbox(filler(), std::move(child), filler());
2018-09-20 03:52:25 +08:00
}
std::unique_ptr<Node> center(Element child) {
return hcenter(vcenter(std::move(child)));
}
std::unique_ptr<Node> align_right(Element child) {
return hbox(filler(), std::move(child));
}
2020-03-23 05:32:44 +08:00
} // namespace ftxui