Refactor submenu creation logic
This commit is contained in:
@@ -70,12 +70,18 @@ struct Rect;
|
||||
class MenuListActivity : public Activity {
|
||||
protected:
|
||||
std::vector<SettingInfo> menuItems;
|
||||
std::vector<SettingInfo::SubmenuData> submenuData;
|
||||
int selectedIndex = 0;
|
||||
ButtonNavigator buttonNavigator;
|
||||
bool submenusPrepared = false;
|
||||
|
||||
// Call after building/rebuilding menuItems to wire up the selectable predicate.
|
||||
void initMenuList();
|
||||
|
||||
// Process SettingInfo items marked with withSubmenu() into submenu placeholders.
|
||||
void prepareSubmenus();
|
||||
void openSubmenu(const SettingInfo& submenuEntry);
|
||||
|
||||
// Handle up/down navigation via buttonNavigator. Call from loop() if overriding.
|
||||
void handleNavigation();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user