18class SelectionStyleReset :
public NodeDecorator {
20 explicit SelectionStyleReset(
Element child)
21 : NodeDecorator(std::move(child)) {}
24 auto old_style =
screen.GetSelectionStyle();
25 screen.SetSelectionStyle([](Pixel&) {});
27 screen.SetSelectionStyle(old_style);
31class SelectionStyle :
public NodeDecorator {
33 SelectionStyle(
Element child,
const std::function<
void(Pixel&)>& style)
34 : NodeDecorator(std::move(child)),
style_(style) {}
37 auto old_style =
screen.GetSelectionStyle();
38 auto new_style = [&, old_style](Pixel& pixel) {
42 screen.SetSelectionStyle(new_style);
44 screen.SetSelectionStyle(old_style);
56 return std::make_shared<SelectionStyleReset>(std::move(child));
88 return std::make_shared<SelectionStyle>(std::move(child), style);
friend void Render(Screen &screen, Node *node, Selection &selection)
void Render(Screen &screen, const Element &element)
Muestra un elemento en un ftxui::Screen.
Color es una clase que representa un color en la interfaz de usuario de la terminal.
Un carácter Unicode y su estilo asociado.
El espacio de nombres ftxui:: de FTXUI.
std::function< Element(Element)> Decorator
std::shared_ptr< Node > Element
Decorator selectionStyle(std::function< void(Pixel &)> style)
Establece el estilo de un elemento cuando está seleccionado.
Decorator selectionForegroundColor(Color foreground)
Establece el color de primer plano de un elemento cuando está seleccionado. Tenga en cuenta que el es...
Decorator selectionBackgroundColor(Color foreground)
Establece el color de fondo de un elemento cuando está seleccionado. Tenga en cuenta que el estilo se...
Decorator selectionColor(Color foreground)
Establece el color de un elemento cuando está seleccionado.
Element selectionStyleReset(Element)
Restablece el estilo de selección de un elemento.
std::function< void(Pixel &)> style_