Skip to content

Commit

Permalink
fix(color): Model quick select not working (#4369)
Browse files Browse the repository at this point in the history
  • Loading branch information
philmoz authored Nov 29, 2023
1 parent 3971a70 commit f8106de
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions radio/src/gui/colorlcd/model_select.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,11 @@ class ModelButton : public Button
ModelButton(FormWindow *parent, const rect_t &rect, ModelCell *modelCell,
std::function<void()> setSelected) :
Button(parent, rect, nullptr, 0, 0, etx_button_create),
modelCell(modelCell)
modelCell(modelCell),
m_setSelected(std::move(setSelected))
{
padAll(0);

m_setSelected = std::move(setSelected);

lv_obj_clear_flag(lvobj, LV_OBJ_FLAG_CLICK_FOCUSABLE);
setWidth(MODEL_SELECT_CELL_WIDTH);
setHeight(MODEL_SELECT_CELL_HEIGHT);
Expand Down Expand Up @@ -134,6 +133,8 @@ class ModelButton : public Button
{
if (!lv_obj_has_state(lvobj, LV_STATE_FOCUSED)) {
lv_group_focus_obj(lvobj);
} else {
if (m_setSelected) m_setSelected();
}
}

Expand Down Expand Up @@ -533,6 +534,7 @@ void ModelLabelsWindow::onPressPG(bool isNext)

sellist.insert(select);
lblselector->setSelected(sellist); // Check the items
lblselector->setSelected(-1); // Force update
lblselector->setSelected(select); // Causes the list to scroll
updateFilteredLabels(sellist); // Update the models
}
Expand Down Expand Up @@ -662,7 +664,8 @@ void ModelLabelsWindow::buildBody(FormWindow *window)
#endif
lv_obj_set_grid_cell(box->getLvObj(), LV_GRID_ALIGN_STRETCH, 0, 1,
LV_GRID_ALIGN_STRETCH, LABELS_ROW, 1);
lblselector = new ListBox(box, rect_t{0, 0, LV_PCT(100), LV_PCT(100)}, getLabels());
lblselector =
new ListBox(box, rect_t{0, 0, LV_PCT(100), LV_PCT(100)}, getLabels());
auto lbl_obj = lblselector->getLvObj();

// Sort Buttons
Expand Down

0 comments on commit f8106de

Please sign in to comment.