fix themezer search...by actually *doing* the search.

fixes #111
This commit is contained in:
ITotalJustice
2025-04-19 22:50:56 +01:00
parent 6b4e81c935
commit 3141100457

View File

@@ -365,7 +365,13 @@ Menu::Menu() : MenuBase{"Themezer"_i18n} {
fs::FsNativeSd().CreateDirectoryRecursively(CACHE_PATH); fs::FsNativeSd().CreateDirectoryRecursively(CACHE_PATH);
SetAction(Button::B, Action{"Back"_i18n, [this]{ 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( this->SetActions(
@@ -480,6 +486,8 @@ Menu::Menu() : MenuBase{"Themezer"_i18n} {
std::string out; std::string out;
if (R_SUCCEEDED(swkbd::ShowText(out)) && !out.empty()) { if (R_SUCCEEDED(swkbd::ShowText(out)) && !out.empty()) {
m_search = out; m_search = out;
// PackListDownload();
InvalidateAllPages();
} }
})); }));
}}), }}),
@@ -652,11 +660,9 @@ void Menu::OnFocusGained() {
} }
void Menu::InvalidateAllPages() { void Menu::InvalidateAllPages() {
for (auto& e : m_pages) { m_pages.clear();
e.m_packList.clear(); m_pages.resize(1);
e.m_ready = PageLoadState::None; m_page_index = 0;
}
PackListDownload(); PackListDownload();
} }