Massive ~2500% speed improvement for OptionListComponent.

This commit is contained in:
Leon Styhre 2021-09-25 19:22:59 +02:00
parent 3233288a8c
commit 3d6628f084
2 changed files with 4 additions and 3 deletions

View file

@ -39,10 +39,11 @@ public:
void setNeedsSaving() { mNeedsSaving = true; }
void addRow(const ComponentListRow& row, bool setCursorHere = false)
void addRow(const ComponentListRow& row, bool setCursorHere = false, bool updateRowSize = true)
{
mList->addRow(row, setCursorHere);
updateSize();
if (updateRowSize)
updateSize();
}
void addWithLabel(const std::string& label,

View file

@ -409,7 +409,7 @@ private:
}
// Also set cursor to this row if we're not multi-select and this row is selected.
mMenu.addRow(row, (!mParent->mMultiSelect && it->selected));
mMenu.addRow(row, (!mParent->mMultiSelect && it->selected), false);
}
mMenu.addButton("BACK", "back", [this] { delete this; });