FTXUI 6.1.9
C++ functional terminal UI.
Chargement...
Recherche...
Aucune correspondance
strikethrough.cpp
Aller à la documentation de ce fichier.
1// Copyright 2023 Arthur Sonzogni. Tous droits réservés.
2// L'utilisation de ce code source est régie par la licence MIT qui peut être trouvée dans
3// le fichier LICENSE.
4#include <memory> // for make_shared
5#include <utility> // for move
6
7#include "ftxui/dom/elements.hpp" // for Element, strikethrough
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
15/// @brief Applique un barré au texte.
16/// @ingroup dom
18 class Impl : public NodeDecorator {
19 public:
20 using NodeDecorator::NodeDecorator;
21
22 void Render(Screen& screen) override {
23 for (int y = box_.y_min; y <= box_.y_max; ++y) {
24 for (int x = box_.x_min; x <= box_.x_max; ++x) {
25 screen.PixelAt(x, y).strikethrough = true;
26 }
27 }
28 Node::Render(screen);
29 }
30 };
31
32 return std::make_shared<Impl>(std::move(child));
33}
34
35} // namespace ftxui
auto screen
Element strikethrough(Element)
Applique un barré au texte.
void Render(Screen &screen, const Element &element)
Affiche un élément sur un ftxui::Screen.
Definition node.cpp:83
Une grille rectangulaire de pixels.
Definition screen.hpp:26
L'espace de noms FTXUI ftxui::
Definition animation.hpp:10
std::shared_ptr< Node > Element
Definition elements.hpp:22