diff --git a/Common/UI/ViewGroup.h b/Common/UI/ViewGroup.h index bfd2dd61e7..f360af95ca 100644 --- a/Common/UI/ViewGroup.h +++ b/Common/UI/ViewGroup.h @@ -71,7 +71,7 @@ public: void Clear(); void PersistData(PersistStatus status, std::string anonId, PersistMap &storage) override; - View *GetViewByIndex(int index) { return views_[index]; } + View *GetViewByIndex(int index) const { return views_[index]; } int GetNumSubviews() const { return (int)views_.size(); } void SetHasDropShadow(bool has) { hasDropShadow_ = has; } void SetDropShadowExpand(float s) { dropShadowExpand_ = s; } @@ -313,6 +313,10 @@ public: LinearLayout *Container() { return tabContainer_; } + const std::vector &GetTabContentViews() const { + return tabs_; + } + private: void AddTabContents(std::string_view title, View *tabContents); EventReturn OnTabClick(EventParams &e); diff --git a/Core/Util/PPGeDraw.cpp b/Core/Util/PPGeDraw.cpp index 3a4a62e4a1..10cc036fdc 100644 --- a/Core/Util/PPGeDraw.cpp +++ b/Core/Util/PPGeDraw.cpp @@ -1351,7 +1351,7 @@ PPGeImage::PPGeImage(std::string_view pspFilename) PPGeImage::PPGeImage(u32 pngPointer, size_t pngSize) : filename_(""), png_(pngPointer), size_(pngSize) { - if (!Memory::IsValidRange(this->png_, this->size_)) { + if (!Memory::IsValidRange(this->png_, (u32)this->size_)) { WARN_LOG(Log::sceGe, "Created PPGeImage from invalid memory range %08x (%08x bytes). Will not be drawn."); } } @@ -1417,7 +1417,7 @@ bool PPGeImage::IsValid() { if (loadFailed_) return false; - if (!Memory::IsValidRange(this->png_, this->size_)) { + if (!Memory::IsValidRange(this->png_, (u32)this->size_)) { return false; } diff --git a/UI/TabbedDialogScreen.cpp b/UI/TabbedDialogScreen.cpp index cd121139be..7243143dc6 100644 --- a/UI/TabbedDialogScreen.cpp +++ b/UI/TabbedDialogScreen.cpp @@ -16,10 +16,6 @@ UI::LinearLayout *TabbedUIDialogScreenWithGameBackground::AddTab(const char *tag scroll->Add(contents); tabHolder_->AddTab(title, scroll); - if (!isSearch) { - settingTabContents_.push_back(contents); - } - return contents; } @@ -56,7 +52,6 @@ void TabbedUIDialogScreenWithGameBackground::CreateViews() { tabHolder_->SetTag(tag()); // take the tag from the screen. root_->SetDefaultFocusView(tabHolder_); - settingTabContents_.clear(); float leftSide = 40.0f; if (!vertical) { @@ -120,6 +115,7 @@ void TabbedUIDialogScreenWithGameBackground::RecreateViews() { } void TabbedUIDialogScreenWithGameBackground::ApplySearchFilter() { + using namespace UI; auto se = GetI18NCategory(I18NCat::SEARCH); // Show an indicator that a filter is applied. @@ -127,8 +123,26 @@ void TabbedUIDialogScreenWithGameBackground::ApplySearchFilter() { filterNotice_->SetText(ApplySafeSubstitutions(se->T("Filtering settings by '%1'"), searchFilter_)); bool matches = searchFilter_.empty(); - for (int t = 0; t < (int)settingTabContents_.size(); ++t) { - auto tabContents = settingTabContents_[t]; + + const std::vector settingTabs = tabHolder_->GetTabContentViews(); + + for (int t = 0; t < (int)settingTabs.size(); ++t) { + const ViewGroup *tabContents = settingTabs[t]; + std::string_view tag = tabContents->Tag(); + + // Dive down to the actual list of settings. + // TODO: Do this recursively instead. + while (tabContents->GetNumSubviews() == 1) { + View *v = tabContents->GetViewByIndex(0); + if (v->IsViewGroup()) { + tabContents = (ViewGroup *)v; + } + } + + if (tag == "GameSettingsSearch") { + continue; + } + bool tabMatches = searchFilter_.empty(); UI::View *lastHeading = nullptr; diff --git a/UI/TabbedDialogScreen.h b/UI/TabbedDialogScreen.h index 1fb0ea10bb..ae5c3f9ebc 100644 --- a/UI/TabbedDialogScreen.h +++ b/UI/TabbedDialogScreen.h @@ -30,7 +30,6 @@ private: void ApplySearchFilter(); UI::TabHolder *tabHolder_ = nullptr; - std::vector settingTabContents_; UI::TextView *filterNotice_ = nullptr; UI::Choice *clearSearchChoice_ = nullptr; UI::TextView *noSearchResults_ = nullptr;