fix(color): wrong selection order of model buttons on manage models page (#5567)

This commit is contained in:
philmoz
2024-09-30 09:44:50 +10:00
committed by GitHub
parent c1c600cf35
commit 14437cf777
@@ -208,8 +208,10 @@ class ModelsPageBody : public Window
void update() void update()
{ {
for (auto b : modelButtons) for (auto b : modelButtons) {
b->hide(); b->hide();
lv_group_remove_obj(b->getLvObj());
}
ModelsVector models; ModelsVector models;
if (selectedLabels.size()) { if (selectedLabels.size()) {
@@ -245,7 +247,7 @@ class ModelsPageBody : public Window
if (button) { if (button) {
button->setPos(x, y); button->setPos(x, y);
button->show(); button->show();
lv_obj_move_foreground(button->getLvObj()); lv_group_add_obj(lv_group_get_default(), button->getLvObj());
} else { } else {
button = new ModelButton( button = new ModelButton(
this, {x, y, w, h}, model, [=]() { focusedModel = model; }, this, {x, y, w, h}, model, [=]() { focusedModel = model; },