25 void ComputeRequirement()
override {
27 requirement_ = children_[0]->requirement();
31 void SetBox(
Box box)
override {
34 children_[0]->SetBox(
box);
58 const int x = stencil.
x_max;
59 for (
int y = stencil.
y_min; y <= stencil.
y_max; ++y) {
60 const int y_up = 2 * y + 0;
61 const int y_down = 2 * y + 1;
65 const char* c =
up ? (down ?
"┃" :
"╹") : (down ?
"╻" :
" ");
66 screen.PixelAt(x, y).character = c;
70 return std::make_shared<Impl>(std::move(
child));
80 void ComputeRequirement()
override {
82 requirement_ = children_[0]->requirement();
86 void SetBox(
Box box)
override {
89 children_[0]->SetBox(
box);
113 const int y = stencil.
y_max;
114 for (
int x = stencil.
x_min; x <= stencil.
x_max; ++x) {
115 const int x_left = 2 * x + 0;
121 left ? (right ?
"─" :
"╴") : (right ?
"╶" :
" ");
122 screen.PixelAt(x, y).character = c;
126 return std::make_shared<Impl>(std::move(
child));
NodeDecorator(Element child)
void ComputeRequirement() override
Compute how much space an elements needs.
virtual void Render(Screen &screen)
Display an element on a ftxui::Screen.
A rectangular grid of Pixel.
Element vscroll_indicator(Element)
Display a vertical scrollbar to the right. colors.
Decorator size(WidthOrHeight, Constraint, int value)
Apply a constraint on the size of an element.
std::shared_ptr< Node > Element
std::shared_ptr< T > Make(Args &&... args)
Element hscroll_indicator(Element)
Display an horizontal scrollbar to the bottom. colors.
void Render(Screen &screen, const Element &element)
Display an element on a ftxui::Screen.