From ce5ac6b12fccd4a451fceaf65ca95951ed4cf468 Mon Sep 17 00:00:00 2001 From: faizan171997 <31391202+faizan171997@users.noreply.github.com> Date: Thu, 22 Feb 2024 03:12:51 -0800 Subject: [PATCH] - Added exit button to homescreen example (#819) --- 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 98e3490..1af03a5 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, }); });