Add categories for control bindings

This commit is contained in:
Henrik Rydgård committed 2023-12-20 16:20:26 +01:00
1 parent 2d4e59eb62
commit 9cb3d03098
7 files changed
+70 -14

No files matched your search

+7 -3
View File
@@ -1186,9 +1186,7 @@ CollapsibleSection::CollapsibleSection(const std::string &title, LayoutParams *l
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++) {
views_[i]->SetVisibility(open_ ? V_VISIBLE : V_GONE);
}
UpdateVisibility();
return UI::EVENT_DONE;
});
}
@@ -1198,4 +1196,10 @@ void CollapsibleSection::Update() {
heading_->SetHasSubitems(views_.size() > 1);
}
void CollapsibleSection::UpdateVisibility() {
for (size_t i = 1; i < views_.size(); i++) {
views_[i]->SetVisibility(open_ ? V_VISIBLE : V_GONE);
}
}
} // namespace UI