- Added exit button to homescreen example (#819)

This commit is contained in:
faizan171997 2024-02-22 03:12:51 -08:00 committed by GitHub
parent f495ce029c
commit ce5ac6b12f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -490,15 +490,24 @@ int main() {
}, },
&tab_index); &tab_index);
auto exit_button = Button(
"Exit", [&] { screen.Exit(); }, ButtonOption::Animated());
auto main_container = Container::Vertical({ auto main_container = Container::Vertical({
tab_selection, Container::Horizontal({
tab_content, tab_selection,
exit_button,
}),
tab_content,
}); });
auto main_renderer = Renderer(main_container, [&] { auto main_renderer = Renderer(main_container, [&] {
return vbox({ return vbox({
text("FTXUI Demo") | bold | hcenter, text("FTXUI Demo") | bold | hcenter,
tab_selection->Render(), hbox({
tab_selection->Render() | flex,
exit_button->Render(),
}),
tab_content->Render() | flex, tab_content->Render() | flex,
}); });
}); });