mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-12 09:09:29 +01:00
UI: Give views a pointer to their parent group
Set by ViewGroup when a view is added, inserted or swapped in. Lets a view find the scroll view it's in, for example. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
729047d449
commit
5d8db2a22d
3 files changed
+13
-2
No files matched your search
@@ -164,6 +164,7 @@ bool ViewGroup::ReplaceSubview(View *view, View *newView) {
|
||||
for (int i = 0; i < (int)views_.size(); i++) {
|
||||
if (views_[i] == view) {
|
||||
views_[i] = newView;
|
||||
SetParentOf(newView);
|
||||
delete view;
|
||||
return true;
|
||||
}
|
||||
@@ -1042,8 +1043,7 @@ CollapsibleSection::CollapsibleSection(std::string_view title, LayoutParams *lay
|
||||
open_ = &localOpen_;
|
||||
SetSpacing(0.0f);
|
||||
|
||||
header_ = new CollapsibleHeader(open_, title);
|
||||
views_.push_back(header_);
|
||||
header_ = Add(new CollapsibleHeader(open_, title));
|
||||
header_->OnClick.Add([=](UI::EventParams &) {
|
||||
// Change the visibility of all children except the first one.
|
||||
// Later maybe try something more ambitious.
|
||||
|
||||
Reference in new issue
Block a user