From 3141100457488c895991e57d51c60b675d9cd6c2 Mon Sep 17 00:00:00 2001 From: ITotalJustice <47043333+ITotalJustice@users.noreply.github.com> Date: Sat, 19 Apr 2025 22:50:56 +0100 Subject: [PATCH] fix themezer search...by actually *doing* the search. fixes #111 --- sphaira/source/ui/menus/themezer.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/sphaira/source/ui/menus/themezer.cpp b/sphaira/source/ui/menus/themezer.cpp index 32d1536..7973c1c 100644 --- a/sphaira/source/ui/menus/themezer.cpp +++ b/sphaira/source/ui/menus/themezer.cpp @@ -365,7 +365,13 @@ Menu::Menu() : MenuBase{"Themezer"_i18n} { fs::FsNativeSd().CreateDirectoryRecursively(CACHE_PATH); SetAction(Button::B, Action{"Back"_i18n, [this]{ - SetPop(); + // if search is valid, then we are in search mode, return back to normal. + if (!m_search.empty()) { + m_search.clear(); + InvalidateAllPages(); + } else { + SetPop(); + } }}); this->SetActions( @@ -480,6 +486,8 @@ Menu::Menu() : MenuBase{"Themezer"_i18n} { std::string out; if (R_SUCCEEDED(swkbd::ShowText(out)) && !out.empty()) { m_search = out; + // PackListDownload(); + InvalidateAllPages(); } })); }}), @@ -652,11 +660,9 @@ void Menu::OnFocusGained() { } void Menu::InvalidateAllPages() { - for (auto& e : m_pages) { - e.m_packList.clear(); - e.m_ready = PageLoadState::None; - } - + m_pages.clear(); + m_pages.resize(1); + m_page_index = 0; PackListDownload(); }