Skip to content

Commit

Permalink
- Added exit button to homescreen example (#819)
Browse files Browse the repository at this point in the history
  • Loading branch information
faizan171997 authored Feb 22, 2024
1 parent f495ce0 commit ce5ac6b
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions examples/component/homescreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,15 +490,24 @@ int main() {
},
&tab_index);

auto exit_button = Button(
"Exit", [&] { screen.Exit(); }, ButtonOption::Animated());

auto main_container = Container::Vertical({
tab_selection,
tab_content,
Container::Horizontal({
tab_selection,
exit_button,
}),
tab_content,
});

auto main_renderer = Renderer(main_container, [&] {
return vbox({
text("FTXUI Demo") | bold | hcenter,
tab_selection->Render(),
hbox({
tab_selection->Render() | flex,
exit_button->Render(),
}),
tab_content->Render() | flex,
});
});
Expand Down

0 comments on commit ce5ac6b

Please sign in to comment.