[Horus] MODEL SELECT bug fixes
This commit is contained in:
@@ -106,6 +106,7 @@ void onCategorySelectMenu(const char * result)
|
|||||||
}
|
}
|
||||||
else if (result == STR_DELETE_CATEGORY) {
|
else if (result == STR_DELETE_CATEGORY) {
|
||||||
modelslist.removeCategory(currentCategory);
|
modelslist.removeCategory(currentCategory);
|
||||||
|
modelslist.save();
|
||||||
setCurrentCategory(currentCategoryIndex-1);
|
setCurrentCategory(currentCategoryIndex-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -260,6 +261,11 @@ bool menuModelSelect(evt_t event)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (currentCategory && currentCategory->size() == 0) {
|
||||||
|
selectMode = MODE_SELECT_CATEGORY;
|
||||||
|
currentModel = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
// Header
|
// Header
|
||||||
theme->drawTopbarBackground(ICON_LIBRARY);
|
theme->drawTopbarBackground(ICON_LIBRARY);
|
||||||
|
|
||||||
@@ -320,21 +326,15 @@ bool menuModelSelect(evt_t event)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (selectMode == MODE_SELECT_MODEL) {
|
if (selectMode == MODE_SELECT_MODEL) {
|
||||||
if (index == 0) {
|
menuVerticalPosition = modelsVerticalPosition;
|
||||||
selectMode = MODE_SELECT_CATEGORY;
|
menuHorizontalPosition = modelsHorizontalPosition;
|
||||||
|
menuVerticalOffset = modelsVerticalOffset;
|
||||||
|
if (navigate(event, index, 3, 2)) {
|
||||||
|
modelsVerticalPosition = menuVerticalPosition;
|
||||||
|
modelsHorizontalPosition = menuHorizontalPosition;
|
||||||
|
modelsVerticalOffset = menuVerticalOffset;
|
||||||
putEvent(EVT_REFRESH);
|
putEvent(EVT_REFRESH);
|
||||||
}
|
setCurrentModel(MODEL_INDEX());
|
||||||
else {
|
|
||||||
menuVerticalPosition = modelsVerticalPosition;
|
|
||||||
menuHorizontalPosition = modelsHorizontalPosition;
|
|
||||||
menuVerticalOffset = modelsVerticalOffset;
|
|
||||||
if (navigate(event, index, 3, 2)) {
|
|
||||||
modelsVerticalPosition = menuVerticalPosition;
|
|
||||||
modelsHorizontalPosition = menuHorizontalPosition;
|
|
||||||
modelsVerticalOffset = menuVerticalOffset;
|
|
||||||
putEvent(EVT_REFRESH);
|
|
||||||
setCurrentModel(MODEL_INDEX());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (currentModel) {
|
if (currentModel) {
|
||||||
lcd->drawText(CATEGORIES_WIDTH+MENUS_MARGIN_LEFT, MENU_FOOTER_TOP+2, currentModel->name, TEXT_INVERTED_COLOR);
|
lcd->drawText(CATEGORIES_WIDTH+MENUS_MARGIN_LEFT, MENU_FOOTER_TOP+2, currentModel->name, TEXT_INVERTED_COLOR);
|
||||||
|
|||||||
Reference in New Issue
Block a user