mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-29 01:03:41 +01:00
UI: CollapsibleHeader no longer shows the open/close icon if there are no items
This commit is contained in:
1 parent
18ac95a107
commit
aa46d3aae3
4 files changed
+20
-4
No files matched your search
@@ -1183,9 +1183,9 @@ StickyChoice *ChoiceStrip::Choice(int index) {
|
||||
CollapsibleSection::CollapsibleSection(const std::string &title, LayoutParams *layoutParams) : LinearLayout(ORIENT_VERTICAL, layoutParams) {
|
||||
SetSpacing(0.0f);
|
||||
|
||||
CollapsibleHeader *heading = new CollapsibleHeader(&open_, title);
|
||||
views_.push_back(heading);
|
||||
heading->OnClick.Add([=](UI::EventParams &) {
|
||||
heading_ = new CollapsibleHeader(&open_, title);
|
||||
views_.push_back(heading_);
|
||||
heading_->OnClick.Add([=](UI::EventParams &) {
|
||||
// Change the visibility of all children except the first one.
|
||||
// Later maybe try something more ambitious.
|
||||
for (size_t i = 1; i < views_.size(); i++) {
|
||||
@@ -1195,4 +1195,9 @@ CollapsibleSection::CollapsibleSection(const std::string &title, LayoutParams *l
|
||||
});
|
||||
}
|
||||
|
||||
void CollapsibleSection::Update() {
|
||||
ViewGroup::Update();
|
||||
heading_->SetHasSubitems(views_.size() > 1);
|
||||
}
|
||||
|
||||
} // namespace UI
|
||||
Reference in new issue
Block a user