feat: Add options to disable radio and model menu tabs (#3484)
* Add options to disable radio and model menu tabs. - Update radio and model data structs - UI for color LCD radios - Convert existing 'noGlobalFunctions' property. - Language strings. * Make 'theme' control specific to color LCD radios. * Add B&W radio UI. * Simplify code, reduce compiled code size. Fix page count display on model select tab. Fix GVARS for 212x64 radios. * Collapse timer sections if timer is off. * Remove 'Use global functions' checkbox from B&W model setup. * Make preflight checks, throttle and view options sections expand & collapse (default collapsed). * Fix build. * Add view options to companion data classes, save and load values in YAML files. Fix scrolling for radio setup view options. * Add Companion UI for view option settings. * Remove 'Mixes' from list of tabs that can be hidden. * Updated Companion UI from elecpower. * Use view options flags to enable/disable functionality: - skip heli mixer logic if heli not enabled - Remove heli, gvars and telemetry options from source selection if not enabled * Remove 'flight mode', 'curve' and 'global variable' settings from input & mix editors if option disabled. * Rename 'View Options' to 'Enabled Features'. Put GVAR option under Flight Mode and indent text. Make relationship between FM and GV more obvious. * Remove global variable option dependency on flight modes. Hide FM1-FM8 in global variables if flight modes hidden. * Hide 'Custom Mixer Scripts' in source selection menu popup if disabled. * Add translation strings for Hebrew language file. * Fix typo. Add comment for double call to setCurrentTab.
This commit is contained in:
@@ -215,7 +215,7 @@ void menuModelSelect(event_t event)
|
||||
|
||||
#if defined(KEYS_GPIO_REG_PAGEDN)
|
||||
case EVT_KEY_FIRST(KEY_PAGEUP):
|
||||
chainMenu(menuTabModel[DIM(menuTabModel)-1]);
|
||||
chainMenu(menuTabModel[DIM(menuTabModel)-1].menuFunc);
|
||||
killEvents(event);
|
||||
break;
|
||||
|
||||
@@ -224,7 +224,7 @@ void menuModelSelect(event_t event)
|
||||
break;
|
||||
#elif defined(KEYS_GPIO_REG_PAGE)
|
||||
case EVT_KEY_LONG(KEY_PAGE):
|
||||
chainMenu(menuTabModel[DIM(menuTabModel)-1]);
|
||||
chainMenu(menuTabModel[DIM(menuTabModel)-1].menuFunc);
|
||||
killEvents(event);
|
||||
break;
|
||||
|
||||
@@ -242,7 +242,7 @@ void menuModelSelect(event_t event)
|
||||
if ((!IS_ROTARY_RIGHT(event) && !IS_ROTARY_LEFT(event)) || s_editMode < 0) {
|
||||
#endif
|
||||
if (sub == g_eeGeneral.currModel) {
|
||||
chainMenu((IS_ROTARY_RIGHT(event) || event == EVT_KEY_FIRST(KEY_RIGHT)) ? menuModelSetup : menuTabModel[DIM(menuTabModel)-1]);
|
||||
chainMenu((IS_ROTARY_RIGHT(event) || event == EVT_KEY_FIRST(KEY_RIGHT)) ? menuModelSetup : menuTabModel[DIM(menuTabModel)-1].menuFunc);
|
||||
}
|
||||
else {
|
||||
AUDIO_WARNING2();
|
||||
@@ -291,12 +291,14 @@ void menuModelSelect(event_t event)
|
||||
lcdDrawNumber(lcdLastRightPos+3, 0, reusableBuffer.modelsel.eepromfree, LEFT);
|
||||
#endif
|
||||
|
||||
extern uint8_t menuSize(const MenuHandler*, uint8_t);
|
||||
uint8_t sz = menuSize(menuTabModel, DIM(menuTabModel));
|
||||
#if defined(NAVIGATION_X7)
|
||||
drawScreenIndex(MENU_MODEL_SELECT, DIM(menuTabModel), 0);
|
||||
drawScreenIndex(MENU_MODEL_SELECT, sz, 0);
|
||||
#elif defined(ROTARY_ENCODER_NAVIGATION)
|
||||
drawScreenIndex(MENU_MODEL_SELECT, DIM(menuTabModel), (sub == g_eeGeneral.currModel) ? ((IS_ROTARY_ENCODER_NAVIGATION_ENABLE() && s_editMode < 0) ? INVERS|BLINK : INVERS) : 0);
|
||||
drawScreenIndex(MENU_MODEL_SELECT, sz, (sub == g_eeGeneral.currModel) ? ((IS_ROTARY_ENCODER_NAVIGATION_ENABLE() && s_editMode < 0) ? INVERS|BLINK : INVERS) : 0);
|
||||
#else
|
||||
drawScreenIndex(MENU_MODEL_SELECT, DIM(menuTabModel), (sub == g_eeGeneral.currModel) ? INVERS : 0);
|
||||
drawScreenIndex(MENU_MODEL_SELECT, sz, (sub == g_eeGeneral.currModel) ? INVERS : 0);
|
||||
#endif
|
||||
|
||||
title(STR_MENUMODELSEL);
|
||||
|
||||
Reference in New Issue
Block a user