FTXUI 6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
underlined.cpp
Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. Todos los derechos reservados.
2// El uso de este código fuente se rige por la licencia MIT que se puede encontrar en
3// el archivo LICENSE.
4#include <memory> // for make_shared
5#include <utility> // for move
6
7#include "ftxui/dom/elements.hpp" // for Element, underlined
8#include "ftxui/dom/node.hpp" // for Node
9#include "ftxui/dom/node_decorator.hpp" // for NodeDecorator
10#include "ftxui/screen/box.hpp" // for Box
11#include "ftxui/screen/screen.hpp" // for Pixel, Screen
12
13namespace ftxui {
14
15namespace {
16class Underlined : public NodeDecorator {
17 public:
19
20 void Render(Screen& screen) override {
22 for (int y = box_.y_min; y <= box_.y_max; ++y) {
23 for (int x = box_.x_min; x <= box_.x_max; ++x) {
24 screen.PixelAt(x, y).underlined = true;
25 }
26 }
27 }
28};
29} // namespace
30
31/// @brief Subraya el elemento dado.
32/// @ingroup dom
34 return std::make_shared<Underlined>(std::move(child));
35}
36
37} // namespace ftxui
NodeDecorator(Element child)
auto screen
friend void Render(Screen &screen, Node *node, Selection &selection)
Definition node.cpp:96
Element underlined(Element)
Subraya el elemento dado.
void Render(Screen &screen, const Element &element)
Muestra un elemento en un ftxui::Screen.
Definition node.cpp:84
El espacio de nombres ftxui:: de FTXUI.
Definition animation.hpp:10
std::shared_ptr< Node > Element
Definition elements.hpp:22