Miscellaneous refactoring (#160)

* Reorganize ContainerBase

- Reduce Container overloads using default arguments
- Extract member function pointers to virtual functions
- Separate classes for Vertical, Horizontal and Tab containers

* Collect unpack from NodeDecorator subclasses

* Reduce redundant expansion for aliases
This commit is contained in:
Tushar Maheshwari
2021-07-20 13:29:47 +05:30
committed by GitHub
parent 210e8c5863
commit 09805e5e86
15 changed files with 100 additions and 142 deletions

View File

@@ -3,7 +3,8 @@
#include <utility> // for move
#include "ftxui/dom/node.hpp" // for Node, Elements
#include "ftxui/dom/elements.hpp" // for Element, unpack
#include "ftxui/dom/node.hpp" // for Node
namespace ftxui {
struct Box;
@@ -11,7 +12,7 @@ struct Box;
// Helper class.
class NodeDecorator : public Node {
public:
NodeDecorator(Elements children) : Node(std::move(children)) {}
NodeDecorator(Element child) : Node(unpack(std::move(child))) {}
void ComputeRequirement() override;
void SetBox(Box box) override;
};