Spacing default 0.0 in collapsible sections, set spacing for achievements a little higher

This commit is contained in:
Henrik Rydgård 2023-07-16 18:23:43 +02:00
parent f8b7346b8d
commit 7eb1bfe1aa
2 changed files with 8 additions and 3 deletions

View File

@ -1181,6 +1181,8 @@ 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 &) {

View File

@ -116,19 +116,22 @@ void RetroAchievementsListScreen::CreateAchievementsTab(UI::ViewGroup *achieveme
achievements->Add(new GameAchievementSummaryView());
CollapsibleSection *unlocked = new CollapsibleSection(ac->T("Unlocked achievements"));
CollapsibleSection *unlocked = new CollapsibleSection(StringFromFormat("%s (%d)", ac->T("Unlocked achievements"), (int)unlockedAchievements.size()));
unlocked->SetSpacing(2.0f);
for (auto &achievement : unlockedAchievements) {
unlocked->Add(new AchievementView(achievement));
}
achievements->Add(unlocked);
CollapsibleSection *locked = new CollapsibleSection(ac->T("Locked achievements"));
CollapsibleSection *locked = new CollapsibleSection(StringFromFormat("%s (%d)", ac->T("Locked achievements"), (int)lockedAchievements.size()));
unlocked->SetSpacing(2.0f);
for (auto &achievement : lockedAchievements) {
locked->Add(new AchievementView(achievement));
}
achievements->Add(locked);
CollapsibleSection *other = new CollapsibleSection(ac->T("Other achievements"));
CollapsibleSection *other = new CollapsibleSection(StringFromFormat("%s (%d)", ac->T("Other achievements"), (int)otherAchievements.size()));
unlocked->SetSpacing(2.0f);
for (auto &achievement : otherAchievements) {
other->Add(new AchievementView(achievement));
}