Replaced an alignment hack with a proper fix in OptionListComponent.

Also fixed an issue where the number of selected OptionListComponent entries would not get displayed.
This commit is contained in:
Leon Styhre 2021-10-08 22:50:37 +02:00
parent 9c20498339
commit 33792baa53

View file

@ -185,8 +185,7 @@ public:
mEntries.push_back(e);
if (selected)
onSelectedChanged();
onSelectedChanged();
}
bool selectEntry(unsigned int entry)
@ -327,9 +326,6 @@ private:
mParent->onSizeChanged();
}
else {
// Make a size update so the text for the first entry is properly aligned.
setSize(mLeftArrow.getSize() + mRightArrow.getSize());
// Display the selected entry and left/right option arrows.
for (auto it = mEntries.cbegin(); it != mEntries.cend(); it++) {
if (it->selected) {
@ -344,6 +340,7 @@ private:
}
}
}
onSizeChanged();
}
std::vector<HelpPrompt> getHelpPrompts() override