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. All rights reserved.
2// このソースコードの使用は、LICENSEファイルにあるMITライセンスによって管理されています。
3#include <memory> // for make_shared
4#include <utility> // for move
5
6#include "ftxui/dom/elements.hpp" // for Element, underlined
7#include "ftxui/dom/node.hpp" // for Node
8#include "ftxui/dom/node_decorator.hpp" // for NodeDecorator
9#include "ftxui/screen/box.hpp" // for Box
10#include "ftxui/screen/screen.hpp" // for Pixel, Screen
11
12namespace ftxui {
13
14namespace {
15class Underlined : public NodeDecorator {
16 public:
18
19 void Render(Screen& screen) override {
20 Node::Render(screen);
21 for (int y = box_.y_min; y <= box_.y_max; ++y) {
22 for (int x = box_.x_min; x <= box_.x_max; ++x) {
23 screen.PixelAt(x, y).underlined = true;
24 }
25 }
26 }
27};
28} // namespace
29
30/// @brief 指定された要素に下線を追加します。
31/// @ingroup dom
33 return std::make_shared<Underlined>(std::move(child));
34}
35
36} // namespace ftxui
NodeDecorator(Element child)
friend void Render(Screen &screen, Node *node, Selection &selection)
Definition node.cpp:96
Element underlined(Element)
指定された要素に下線を追加します。
void Render(Screen &screen, const Element &element)
要素をftxui::Screenに表示します。
Definition node.cpp:84
FTXUI ftxui:: 名前空間
Definition animation.hpp:9
std::shared_ptr< Node > Element
Definition elements.hpp:21