diff --git a/radio/src/gui/colorlcd/hw_inputs.cpp b/radio/src/gui/colorlcd/hw_inputs.cpp index 5f306b01c55..711373dadd6 100644 --- a/radio/src/gui/colorlcd/hw_inputs.cpp +++ b/radio/src/gui/colorlcd/hw_inputs.cpp @@ -84,15 +84,9 @@ HWPots::HWPots(Window* parent) : FormWindow(parent, rect_t{}) new StaticText(line, rect_t{}, adcGetInputLabel(ADC_INPUT_FLEX, i), 0, COLOR_THEME_PRIMARY1); - auto box = new FormWindow(line, rect_t{}); - box->setFlexLayout(LV_FLEX_FLOW_ROW, lv_dpx(4)); - - auto box_obj = box->getLvObj(); - lv_obj_set_style_flex_cross_place(box_obj, LV_FLEX_ALIGN_CENTER, 0); - - new HWInputEdit(box, (char*)analogGetCustomLabel(ADC_INPUT_FLEX, i), LEN_ANA_NAME); + new HWInputEdit(line, (char*)analogGetCustomLabel(ADC_INPUT_FLEX, i), LEN_ANA_NAME); new Choice( - box, rect_t{}, STR_POTTYPES, FLEX_NONE, FLEX_SWITCH, + line, rect_t{}, STR_POTTYPES, FLEX_NONE, FLEX_SWITCH, [=]() -> int { return bfGet(g_eeGeneral.potsConfig, POT_CFG_BITS * i, POT_CFG_BITS); @@ -155,6 +149,7 @@ HWSwitches::HWSwitches(Window* parent) : FormWindow(parent, rect_t{}) for (int i = 0; i < max_switches; i++) { auto line = newLine(&grid); new SwitchDynamicLabel(line, i); + new HWInputEdit(line, (char*)switchGetCustomName(i), LEN_SWITCH_NAME); auto box = new FormWindow(line, rect_t{}); box->setFlexLayout(LV_FLEX_FLOW_ROW, lv_dpx(4)); @@ -162,7 +157,6 @@ HWSwitches::HWSwitches(Window* parent) : FormWindow(parent, rect_t{}) auto box_obj = box->getLvObj(); lv_obj_set_style_flex_cross_place(box_obj, LV_FLEX_ALIGN_CENTER, 0); - new HWInputEdit(box, (char*)switchGetCustomName(i), LEN_SWITCH_NAME); if (switchIsFlex(i)) { auto channel = new Choice( box, rect_t{}, 0, adcGetMaxInputs(ADC_INPUT_FLEX) - 1, @@ -176,7 +170,7 @@ HWSwitches::HWSwitches(Window* parent) : FormWindow(parent, rect_t{}) } new Choice( - line, rect_t{}, STR_SWTYPES, SWITCH_NONE, switchGetMaxType(i), + box, rect_t{}, STR_SWTYPES, SWITCH_NONE, switchGetMaxType(i), [=]() -> int { return SWITCH_CONFIG(i); }, [=](int newValue) { swconfig_t mask = (swconfig_t)SWITCH_CONFIG_MASK(i);