SNI: Sort items

Reloading/adding new items causes jumps in the item order. Sorting
should stabilize the order
This commit is contained in:
scorpion-26 2023-07-26 14:04:36 +02:00
parent 884d3f1324
commit 09ec1bfab6

View file

@ -364,6 +364,14 @@ namespace SNI
container->SetOrientation(Utils::GetOrientation());
Utils::SetTransform(*container, {-1, true, Alignment::Fill, 0, 8});
iconBox = container.get();
// Sort items, so they don't jump around randomly
std::sort(items.begin(), items.end(),
[](const Item& a, const Item& b)
{
return a.name < b.name;
});
for (auto& item : items)
{
if (item.iconData)