15 using namespace ftxui;
16 auto screen = ScreenInteractive::TerminalOutput();
22 std::string rating =
"3/5 estrellas";
25 auto button_rate_ftxui = Button(
"Calificar FTXUI", [&] { depth = 1; });
26 auto button_quit = Button(
"Salir",
screen.ExitLoopClosure());
28 auto depth_0_container = Container::Horizontal({
32 auto depth_0_renderer = Renderer(depth_0_container, [&] {
34 text(
"Ejemplo de diálogo modal"),
36 text(
"☆☆☆ FTXUI:" + rating +
" ☆☆☆") | bold,
39 button_rate_ftxui->Render(),
41 button_quit->Render(),
44 border |
size(HEIGHT, GREATER_THAN, 18) | center;
48 std::vector<std::string> rating_labels = {
49 "1/5 estrellas",
"2/5 estrellas",
"3/5 estrellas",
"4/5 estrellas",
"5/5 estrellas",
51 auto on_rating = [&](std::string new_rating) {
55 auto depth_1_container = Container::Horizontal({
56 Button(&rating_labels[0], [&] { on_rating(rating_labels[0]); }),
57 Button(&rating_labels[1], [&] { on_rating(rating_labels[1]); }),
58 Button(&rating_labels[2], [&] { on_rating(rating_labels[2]); }),
59 Button(&rating_labels[3], [&] { on_rating(rating_labels[3]); }),
60 Button(&rating_labels[4], [&] { on_rating(rating_labels[4]); }),
63 auto depth_1_renderer = Renderer(depth_1_container, [&] {
65 text(
"¿Te gusta FTXUI?"),
67 hbox(depth_1_container->Render()),
80 Element document = depth_0_renderer->Render();
85 depth_1_renderer->Render() | clear_under | center,
return hbox({ text(std::to_string(int(progress *100))+"% ")|size(WIDTH, EQUAL, 5), gauge(progress), })