From ddf6222d6b15f8deb0ca0a19acc3aa981fef8755 Mon Sep 17 00:00:00 2001 From: Peter Feerick Date: Thu, 13 Apr 2023 20:40:58 +1000 Subject: [PATCH] chore(afhds3): UI cosmetics and formatting Post #3443 cleanup --- radio/src/gui/colorlcd/afhds3_options.cpp | 35 ++++++++++++----------- radio/src/translations/fr.h | 2 +- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/radio/src/gui/colorlcd/afhds3_options.cpp b/radio/src/gui/colorlcd/afhds3_options.cpp index 02b9438d9..1e3de6109 100644 --- a/radio/src/gui/colorlcd/afhds3_options.cpp +++ b/radio/src/gui/colorlcd/afhds3_options.cpp @@ -152,10 +152,13 @@ AFHDS3_Options::AFHDS3_Options(uint8_t moduleIdx) : Page(ICON_MODEL_SETUP) cfg = afhds3::getConfig(moduleIdx); std::string title = moduleIdx == INTERNAL_MODULE ? STR_INTERNALRF : STR_EXTERNALRF; - title += "AFHDS3"; - title += moduleIdx == INTERNAL_MODULE ?"\nINRM301":"\nFRM303"; header.setTitle(title); + title = "AFHDS3 ("; + title += (moduleIdx == INTERNAL_MODULE ? "INRM301" : "FRM303"); + title += ")"; + header.setTitle2(title); + auto form = new FormGroup(&body, rect_t{}); form->setFlexLayout(); form->padAll(lv_dpx(8)); @@ -170,17 +173,16 @@ AFHDS3_Options::AFHDS3_Options(uint8_t moduleIdx) : Page(ICON_MODEL_SETUP) temp_str += TR_POWERMETER_FREQ; new StaticText(line, rect_t{}, temp_str); new PWMfrequencyChoice(line, moduleIdx ); - //new NumberEdit(line, rect_t{}, 50, 400, GET_SET_DEFAULT(vCfg->PWMFrequency.Frequency)); temp_str ="PWM"; temp_str +=STR_SYNC; line = form->newLine(&grid); + new StaticText(line, rect_t{}, temp_str); new CheckBox(line, rect_t{}, GET_SET_DEFAULT(vCfg->PWMFrequency.Synchronized)); - - line = form->newLine(&grid); - temp_str = TR_CHANS; - temp_str += "1"; + + temp_str = STR_CH; + temp_str += " 1"; new StaticText(line, rect_t{}, temp_str ); new Choice(line, rect_t{}, _analog_outputs, afhds3::SES_ANALOG_OUTPUT_PWM, afhds3::SES_ANALOG_OUTPUT_PPM, @@ -195,15 +197,16 @@ AFHDS3_Options::AFHDS3_Options(uint8_t moduleIdx) : Page(ICON_MODEL_SETUP) } else { auto vCfg = &cfg->v1; for (uint8_t i = 0; i < channel_num[vCfg->PhyMode]; i++) { - std::string temp_str=TR_CHANS; - temp_str += std::to_string(i+1); + std::string temp_str = STR_CH; + temp_str += " " + std::to_string(i+1); auto line = form->newLine(&grid); new StaticText(line, rect_t{}, temp_str); new PWMfrequencyChoice(line, moduleIdx, i); - - temp_str ="PWM"; - temp_str +=STR_SYNC; line = form->newLine(&grid); + + temp_str = "PWM"; + temp_str += " "; + temp_str += STR_SYNC; new StaticText(line, rect_t{}, temp_str); new CheckBox( line, rect_t{}, GET_DEFAULT((vCfg->PWMFrequenciesV1.Synchronized&1<>i), @@ -240,10 +243,10 @@ AFHDS3_Options::AFHDS3_Options(uint8_t moduleIdx) : Page(ICON_MODEL_SETUP) new StaticText(line, rect_t{}, STR_SIGNAL_OUTPUT); std::vector signed_strength_ch; signed_strength_ch.emplace_back(STR_OFF); - for(int i=0; iv1.PhyMode]; i++ ){ - std::string temstr = TR_CHANS; - temstr += std::to_string(i+1); - signed_strength_ch.emplace_back(temstr); + for (int i = 0; i < channel_num[cfg->v1.PhyMode]; i++) { + std::string temstr = STR_CH; + temstr += " " + std::to_string(i + 1); + signed_strength_ch.emplace_back(temstr); } new Choice(line, rect_t{}, signed_strength_ch, 0, channel_num[cfg->v1.PhyMode], diff --git a/radio/src/translations/fr.h b/radio/src/translations/fr.h index a8c4098a9..56ed1227f 100644 --- a/radio/src/translations/fr.h +++ b/radio/src/translations/fr.h @@ -1307,4 +1307,4 @@ #define TR_ANALOG_SERVO "Servo 50HZ" #define TR_SIGNAL_OUTPUT "Signal output" #define TR_SERIAL_BUS "Serial bus" -#define TR_SYNC "Sync" \ No newline at end of file +#define TR_SYNC "Sync"