17 using namespace ftxui;
19 InputOption style_1 = InputOption::Default();
21 InputOption style_2 = InputOption::Spacious();
23 InputOption style_3 = InputOption::Spacious();
24 style_3.transform = [](InputState state) {
25 state.element |= borderEmpty;
27 if (state.is_placeholder) {
32 state.element |= borderDouble;
33 state.element |= bgcolor(Color::White);
34 state.element |= color(Color::Black);
35 }
else if (state.hovered) {
36 state.element |= borderRounded;
37 state.element |= bgcolor(LinearGradient(90, Color::Blue, Color::Red));
38 state.element |= color(Color::White);
40 state.element |= border;
41 state.element |= bgcolor(LinearGradient(0, Color::Blue, Color::Red));
42 state.element |= color(Color::White);
48 InputOption style_4 = InputOption::Spacious();
49 style_4.transform = [](InputState state) {
50 state.element = hbox({
51 text(
"Theorem") | center | borderEmpty | bgcolor(Color::Red),
53 separator() | color(Color::White),
55 std::move(state.element),
58 state.element |= borderEmpty;
59 if (state.is_placeholder) {
64 state.element |= bgcolor(Color::Black);
66 state.element |= bgcolor(Color::Blue);
70 state.element |= bgcolor(Color::GrayDark);
73 return vbox({state.element, separatorEmpty()});
76 auto generateUiFromStyle = [&](InputOption style) {
77 auto first_name =
new std::string();
78 auto middle_name =
new std::string();
79 auto last_name =
new std::string();
80 return Container::Vertical({
81 Input(first_name,
"first name", style),
82 Input(middle_name,
"middle name", style),
83 Input(last_name,
"last name", style),
88 auto ui = Container::Horizontal({
89 generateUiFromStyle(style_1),
90 generateUiFromStyle(style_2),
91 generateUiFromStyle(style_3),
92 generateUiFromStyle(style_4),
95 auto screen = App::TerminalOutput();