From b6497c03f651c4c23f6863ae84356efdb4baf85c Mon Sep 17 00:00:00 2001 From: ITotalJustice <47043333+ITotalJustice@users.noreply.github.com> Date: Mon, 21 Jul 2025 12:40:54 +0100 Subject: [PATCH] backport widget changes from totalsms --- sphaira/include/app.hpp | 2 +- sphaira/include/ui/nvg_util.hpp | 4 +- sphaira/include/ui/option_box.hpp | 14 ++- sphaira/include/ui/popup_list.hpp | 2 +- sphaira/include/ui/sidebar.hpp | 3 + sphaira/include/ui/types.hpp | 7 ++ sphaira/include/ui/widget.hpp | 9 +- sphaira/source/app.cpp | 157 +++++++++++---------------- sphaira/source/ui/nvg_util.cpp | 11 +- sphaira/source/ui/option_box.cpp | 25 +++-- sphaira/source/ui/popup_list.cpp | 8 +- sphaira/source/ui/scrolling_text.cpp | 2 +- sphaira/source/ui/sidebar.cpp | 20 +++- sphaira/source/ui/widget.cpp | 84 ++++++++------ 14 files changed, 188 insertions(+), 160 deletions(-) diff --git a/sphaira/include/app.hpp b/sphaira/include/app.hpp index a4f4923..443d130 100644 --- a/sphaira/include/app.hpp +++ b/sphaira/include/app.hpp @@ -302,7 +302,7 @@ public: option::OptionBool m_install_sysmmc{INI_SECTION, "install_sysmmc", false}; option::OptionBool m_install_emummc{INI_SECTION, "install_emummc", false}; option::OptionBool m_install_sd{INI_SECTION, "install_sd", true}; - option::OptionLong m_install_prompt{INI_SECTION, "install_prompt", true}; + option::OptionBool m_install_prompt{INI_SECTION, "install_prompt", true}; option::OptionBool m_allow_downgrade{INI_SECTION, "allow_downgrade", false}; option::OptionBool m_skip_if_already_installed{INI_SECTION, "skip_if_already_installed", true}; option::OptionBool m_ticket_only{INI_SECTION, "ticket_only", false}; diff --git a/sphaira/include/ui/nvg_util.hpp b/sphaira/include/ui/nvg_util.hpp index 2fb6ae5..d53d7a9 100644 --- a/sphaira/include/ui/nvg_util.hpp +++ b/sphaira/include/ui/nvg_util.hpp @@ -6,8 +6,8 @@ namespace sphaira::ui::gfx { -void drawImage(NVGcontext*, float x, float y, float w, float h, int texture, float rounded = 0.F); -void drawImage(NVGcontext*, const Vec4& v, int texture, float rounded = 0.F); +void drawImage(NVGcontext*, float x, float y, float w, float h, int texture, float rounded = 0.F, float alpha = 1.0F); +void drawImage(NVGcontext*, const Vec4& v, int texture, float rounded = 0.F, float alpha = 1.0F); void dimBackground(NVGcontext*); diff --git a/sphaira/include/ui/option_box.hpp b/sphaira/include/ui/option_box.hpp index 03356d9..54038bb 100644 --- a/sphaira/include/ui/option_box.hpp +++ b/sphaira/include/ui/option_box.hpp @@ -32,9 +32,10 @@ public: using Options = std::vector