mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-22 18:59:59 +08:00
- Added exit button to homescreen example (#819)
This commit is contained in:
parent
f495ce029c
commit
ce5ac6b12f
@ -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({
|
||||||
|
Container::Horizontal({
|
||||||
tab_selection,
|
tab_selection,
|
||||||
|
exit_button,
|
||||||
|
}),
|
||||||
tab_content,
|
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,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user