FTXUI 6.1.9
C++ functional terminal UI.
Loading...
Searching...
No Matches
bold.cpp
Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. 全著作権所有。
2// このソースコードの使用は、以下に記載されているMITライセンスに従います。
3// LICENSE ファイル。
4#include <memory> // for make_shared
5#include <utility> // for move
6
7#include "ftxui/dom/elements.hpp" // for Element, bold
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 Bold : public NodeDecorator {
17 public:
19
20 void Render(Screen& screen) override {
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).bold = true;
24 }
25 }
26 Node::Render(screen);
27 }
28};
29} // namespace
30
31/// @brief より強調したい要素に、太字フォントを使用します。
32/// @ingroup dom
34 return std::make_shared<Bold>(std::move(child));
35}
36
37} // namespace ftxui
NodeDecorator(Element child)
friend void Render(Screen &screen, Node *node, Selection &selection)
Definition node.cpp:96
Element bold(Element)
より強調したい要素に、太字フォントを使用します。
Definition bold.cpp:33
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