Feature resizable spilt with custom separator (#583)

* Feature: ResizableSplit with custom separator

This resolves:
    https://github.com/ArthurSonzogni/FTXUI/issues/580

Co-authored-by: Pin Loon Lee <pinloon_0428@hotmail.com>
This commit is contained in:
Arthur Sonzogni
2023-03-09 20:21:23 +01:00
committed by GitHub
parent 436c237213
commit 9b074d1e27
15 changed files with 385 additions and 310 deletions

View File

@@ -3,7 +3,7 @@
#include <utility> // for move
#include <vector> // for __alloc_traits<>::value_type
#include "ftxui/dom/elements.hpp" // for Constraint, Direction, EQUAL, GREATER_THAN, LESS_THAN, WIDTH, unpack, Decorator, Element, size
#include "ftxui/dom/elements.hpp" // for Constraint, WidthOrHeight, EQUAL, GREATER_THAN, LESS_THAN, WIDTH, unpack, Decorator, Element, size
#include "ftxui/dom/node.hpp" // for Node, Elements
#include "ftxui/dom/requirement.hpp" // for Requirement
#include "ftxui/screen/box.hpp" // for Box
@@ -12,7 +12,7 @@ namespace ftxui {
class Size : public Node {
public:
Size(Element child, Direction direction, Constraint constraint, int value)
Size(Element child, WidthOrHeight direction, Constraint constraint, int value)
: Node(unpack(std::move(child))),
direction_(direction),
constraint_(constraint),
@@ -71,7 +71,7 @@ class Size : public Node {
}
private:
Direction direction_;
WidthOrHeight direction_;
Constraint constraint_;
int value_;
};
@@ -82,7 +82,7 @@ class Size : public Node {
/// @param constraint The type of constaint.
/// @param value The value.
/// @ingroup dom
Decorator size(Direction direction, Constraint constraint, int value) {
Decorator size(WidthOrHeight direction, Constraint constraint, int value) {
return [=](Element e) {
return std::make_shared<Size>(std::move(e), direction, constraint, value);
};