From 061e163a62b8c018b06ab5a20a87a34293255835 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Fri, 2 Sep 2016 18:51:56 +0200 Subject: [PATCH] [Horus + Taranis] Navigation improvement in the Trainer menu --- radio/src/gui/212x64/radio_trainer.cpp | 17 ++++++++--------- radio/src/gui/480x272/radio_trainer.cpp | 25 ++++++++++++------------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/radio/src/gui/212x64/radio_trainer.cpp b/radio/src/gui/212x64/radio_trainer.cpp index 140d4610a..4f010595f 100644 --- a/radio/src/gui/212x64/radio_trainer.cpp +++ b/radio/src/gui/212x64/radio_trainer.cpp @@ -27,7 +27,7 @@ void menuRadioTrainer(event_t event) uint8_t y; bool slave = SLAVE_MODE(); - MENU(STR_MENUTRAINER, menuTabGeneral, MENU_RADIO_TRAINER, (slave ? 0 : 6), { 2, 2, 2, 2, 0/*, 0*/ }); + MENU(STR_MENUTRAINER, menuTabGeneral, MENU_RADIO_TRAINER, (slave ? 0 : 6), { NAVIGATION_LINE_BY_LINE|2, NAVIGATION_LINE_BY_LINE|2, NAVIGATION_LINE_BY_LINE|2, NAVIGATION_LINE_BY_LINE|2, 0, 0 }); if (slave) { lcdDrawText(7*FW, 4*FH, STR_SLAVE); @@ -40,17 +40,16 @@ void menuRadioTrainer(event_t event) lcdDrawText(3*FW, MENU_HEADER_HEIGHT+1, STR_MODESRC); y = MENU_HEADER_HEIGHT + 1 + FH; - int sub = menuVerticalPosition + 1; - for (int i=1; i<=NUM_STICKS; i++) { - uint8_t chan = channel_order(i); - volatile TrainerMix *td = &g_eeGeneral.trainer.mix[chan-1]; + for (int i=0; i0) ? BLINK|INVERS : INVERS); + LcdFlags attr; + LcdFlags blink = ((s_editMode>0) ? BLINK|INVERS : INVERS); /* lcdDrawText(TRAINER_COLUMN_1, MENU_HEADER_HEIGHT+1, "Mode", HEADER_COLOR); lcdDrawText(TRAINER_COLUMN_2, MENU_HEADER_HEIGHT+1, "Weight", HEADER_COLOR); @@ -46,19 +46,18 @@ bool menuRadioTrainer(event_t event) */ y = MENU_CONTENT_TOP + FH; - int sub = menuVerticalPosition + 1; - for (int i=1; i<=NUM_STICKS; i++) { - uint8_t chan = channel_order(i); - volatile TrainerMix *td = &g_eeGeneral.trainer.mix[chan-1]; + for (uint8_t i=0; imode, attr); if (attr&BLINK) CHECK_INCDEC_GENVAR(event, td->mode, 0, 2); @@ -78,12 +77,12 @@ bool menuRadioTrainer(event_t event) y += FH; } - attr = (sub==5) ? blink : 0; + attr = (menuVerticalPosition==4) ? blink : 0; lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP + 5*FH, STR_MULTIPLIER); lcdDrawNumber(TRAINER_COLUMN_1, MENU_CONTENT_TOP + 5*FH, g_eeGeneral.PPM_Multiplier+10, LEFT|attr|PREC1); if (attr) CHECK_INCDEC_GENVAR(event, g_eeGeneral.PPM_Multiplier, -10, 40); - attr = (sub==6) ? INVERS : 0; + attr = (menuVerticalPosition==5) ? INVERS : 0; if (attr) s_editMode = 0; lcdDrawText(MENUS_MARGIN_LEFT, MENU_CONTENT_TOP + 6*FH, STR_CAL, attr); for (int i=0; i<4; i++) {