FTXUI 6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
composite_decorator.cpp
Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
2// Use of this source code is governed by the MIT license that can be found in
3// the LICENSE file.
4
5#include <utility> // for move
6
7#include "ftxui/dom/elements.hpp" // for Element, filler, operator|, hbox, flex_grow, vbox, xflex_grow, yflex_grow, align_right, center, hcenter, vcenter
8
9namespace ftxui {
10
11/// @brief Centra un elemento horizontalmente.
12/// @param child El elemento decorado.
13/// @return El elemento centrado.
14/// @ingroup dom
16 return hbox(filler(), std::move(child), filler());
17}
18
19/// @brief Centra un elemento verticalmente.
20/// @param child El elemento decorado.
21/// @return El elemento centrado.
22/// @ingroup dom
24 return vbox(filler(), std::move(child), filler());
25}
26
27/// @brief Centra un elemento horizontal y verticalmente.
28/// @param child El elemento decorado.
29/// @return El elemento centrado.
30/// @ingroup dom
32 return hcenter(vcenter(std::move(child)));
33}
34
35/// @brief Alinea un elemento a la derecha.
36/// @param child El elemento decorado.
37/// @return El elemento alineado a la derecha.
38/// @ingroup dom
40 return hbox(filler(), std::move(child));
41}
42
43} // namespace ftxui
Element center(Element)
Centra un elemento horizontal y verticalmente.
Element align_right(Element)
Alinea un elemento a la derecha.
Element filler()
Un elemento que se expandirá proporcionalmente al espacio restante en un contenedor.
Definition flex.cpp:98
Element vcenter(Element)
Centra un elemento verticalmente.
Element hcenter(Element)
Centra un elemento horizontalmente.
El espacio de nombres ftxui:: de FTXUI.
Definition animation.hpp:10
std::shared_ptr< Node > Element
Definition elements.hpp:22
Element hbox(Elements)
Un contenedor que muestra elementos horizontalmente uno por uno.
Definition hbox.cpp:94
Element vbox(Elements)