mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-25 15:28:09 +08:00
Add clang-tidy. (#368)
This commit is contained in:
@@ -1,25 +1,32 @@
|
||||
#include <ftxui/dom/elements.hpp> // for operator|, color, Element, bgcolor, graph, border
|
||||
#include <stdlib.h> // for EXIT_SUCCESS
|
||||
#include <ftxui/dom/elements.hpp> // for operator|=, Element, bgcolor, color, graph, border
|
||||
#include <ftxui/screen/screen.hpp> // for Fixed, Screen
|
||||
#include <vector> // for vector
|
||||
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for Color, Color::DarkBlue, Color::Green, Color::Red, ftxui
|
||||
#include "ftxui/dom/node.hpp" // for Render
|
||||
#include "ftxui/screen/color.hpp" // for Color, Color::DarkBlue, Color::Red, ftxui
|
||||
|
||||
int main(void) {
|
||||
int main() {
|
||||
using namespace ftxui;
|
||||
Element document = graph([](int x, int y) {
|
||||
std::vector<int> result(x, 0);
|
||||
for (int i{0}; i < x; ++i) {
|
||||
result[i] = ((3 * i) / 2) % y;
|
||||
}
|
||||
return result;
|
||||
}) |
|
||||
color(Color::Red) | border | color(Color::Green) |
|
||||
bgcolor(Color::DarkBlue);
|
||||
std::vector<int> result(x, 0);
|
||||
for (int i{0}; i < x; ++i) {
|
||||
result[i] = ((3 * i) / 2) % y;
|
||||
}
|
||||
return result;
|
||||
});
|
||||
|
||||
auto screen = Screen::Create(Dimension::Fixed(80), Dimension::Fixed(10));
|
||||
document |= color(Color::Red);
|
||||
document |= bgcolor(Color::DarkBlue);
|
||||
document |= border;
|
||||
|
||||
const int width = 80;
|
||||
const int height = 10;
|
||||
auto screen =
|
||||
Screen::Create(Dimension::Fixed(width), Dimension::Fixed(height));
|
||||
Render(screen, document);
|
||||
screen.Print();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
// Copyright 2020 Arthur Sonzogni. All rights reserved.
|
||||
|
Reference in New Issue
Block a user