Merge branch 'menu-default-select'
This commit is contained in:
+5
-4
@@ -122,11 +122,7 @@ class MenuBody: public Window
|
||||
|
||||
protected:
|
||||
std::vector<MenuLine> lines;
|
||||
#if defined(HARDWARE_TOUCH)
|
||||
int selectedIndex = -1;
|
||||
#else
|
||||
int selectedIndex = 0;
|
||||
#endif
|
||||
std::function<void()> onCancel;
|
||||
|
||||
inline Menu * getParentMenu();
|
||||
@@ -185,6 +181,11 @@ class Menu: public ModalWindow
|
||||
waitHandler = std::move(handler);
|
||||
}
|
||||
|
||||
void setFocusBody(uint8_t flag = SET_FOCUS_DEFAULT)
|
||||
{
|
||||
content->body.setFocus(flag);
|
||||
}
|
||||
|
||||
void setToolbar(Window * window)
|
||||
{
|
||||
toolbar = window;
|
||||
|
||||
@@ -156,9 +156,11 @@ class MenuToolbar: public FormGroup {
|
||||
choice->fillMenu(menu, [=](int16_t index) {
|
||||
return index >= filtermin && index <= filtermax;
|
||||
});
|
||||
menu->setFocusBody();
|
||||
}
|
||||
else {
|
||||
choice->fillMenu(menu);
|
||||
menu->setFocusBody();
|
||||
}
|
||||
return 1;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user