From 1b4ec625c7b1ad51192396b59a2f9d72ed422c1e Mon Sep 17 00:00:00 2001 From: Faizan Shaikh Date: Wed, 21 Feb 2024 18:27:14 -0800 Subject: [PATCH] - Added exit button to homescreen example --- examples/component/homescreen.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/examples/component/homescreen.cpp b/examples/component/homescreen.cpp index 98e3490e..1af03a5d 100644 --- a/examples/component/homescreen.cpp +++ b/examples/component/homescreen.cpp @@ -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, }); });