Fix regression in save data manager search

This commit is contained in:
Henrik Rydgård 2025-03-27 14:46:08 +01:00
parent 85304d58a8
commit ae7586e313
3 changed files with 8 additions and 1 deletions

View file

@ -635,7 +635,6 @@ void SavedataScreen::CreateSavedataTab(UI::ViewGroup *savedata) {
if (!searchFilter_.empty())
dataBrowser_->SetSearchFilter(searchFilter_);
dataBrowser_->OnChoice.Handle(this, &SavedataScreen::OnSavedataButtonClick);
}
void SavedataScreen::CreateSavestateTab(UI::ViewGroup *savestate) {
@ -716,7 +715,10 @@ void SavedataScreen::dialogFinished(const Screen *dialog, DialogResult result) {
void SavedataScreen::sendMessage(UIMessage message, const char *value) {
UIDialogScreenWithGameBackground::sendMessage(message, value);
if (message == UIMessage::SAVEDATA_SEARCH) {
EnsureTabs();
searchFilter_ = value;
dataBrowser_->SetSearchFilter(searchFilter_);
stateBrowser_->SetSearchFilter(searchFilter_);

View file

@ -115,6 +115,10 @@ void TabbedUIDialogScreenWithGameBackground::RecreateViews() {
UIScreen::RecreateViews();
}
void TabbedUIDialogScreenWithGameBackground::EnsureTabs() {
tabHolder_->EnsureAllCreated();
}
void TabbedUIDialogScreenWithGameBackground::ApplySearchFilter() {
using namespace UI;
auto se = GetI18NCategory(I18NCat::SEARCH);

View file

@ -21,6 +21,7 @@ protected:
virtual void CreateTabs() = 0;
virtual void CreateExtraButtons(UI::LinearLayout *verticalLayout, int margins) {}
virtual bool ShowSearchControls() const { return true; }
virtual void EnsureTabs();
void RecreateViews() override;
void sendMessage(UIMessage message, const char *value) override;