mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-24 03:30:49 +08:00
e1a71d5b9f
This allow users to pass it into initializer list. Then clang-format will produce 'acceptable' indentations. This fixes: https://github.com/ArthurSonzogni/FTXUI/issues/18
32 lines
796 B
C++
32 lines
796 B
C++
// Copyright 2020 Arthur Sonzogni. All rights reserved.
|
|
// Use of this source code is governed by the MIT license that can be found in
|
|
// the LICENSE file.
|
|
|
|
#include "ftxui/dom/elements.hpp"
|
|
#include "ftxui/dom/node_decorator.hpp"
|
|
|
|
namespace ftxui {
|
|
|
|
using ftxui::Screen;
|
|
|
|
class Underlined : public NodeDecorator {
|
|
public:
|
|
Underlined(Elements children) : NodeDecorator(std::move(children)) {}
|
|
~Underlined() override {}
|
|
|
|
void Render(Screen& screen) override {
|
|
Node::Render(screen);
|
|
for (int y = box_.y_min; y <= box_.y_max; ++y) {
|
|
for (int x = box_.x_min; x <= box_.x_max; ++x) {
|
|
screen.PixelAt(x, y).underlined = true;
|
|
}
|
|
}
|
|
}
|
|
};
|
|
|
|
Element underlined(Element child) {
|
|
return std::make_shared<Underlined>(unpack(std::move(child)));
|
|
}
|
|
|
|
} // namespace ftxui
|