Skip to content

Commit

Permalink
fix(bw): 212x64 trainer page text overlap (EdgeTX#4274)
Browse files Browse the repository at this point in the history
  • Loading branch information
pfeerick authored and MRC3742 committed Dec 22, 2023
1 parent aae62d7 commit d1a3afc
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions radio/src/gui/common/stdlcd/radio_trainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@

#include "opentx.h"

#define COL_TWO (5 * FW)
#if LCD_W >= 212
#define TRAINER_CALIB_COLUMN_WIDTH (6 * FW)
#define COL_THREE (16 * FW)
#define COL_FOUR (17 * FW)
#define TRAINER_CALIB_COLUMN_WIDTH (6 * FW)
#else
#define TRAINER_CALIB_COLUMN_WIDTH (4 * FW + 2)
#define COL_THREE (12 * FW)
#define COL_FOUR (13 * FW)
#define TRAINER_CALIB_COLUMN_WIDTH (4 * FW + 2)
#endif

void menuRadioTrainer(event_t event)
Expand All @@ -42,9 +47,9 @@ void menuRadioTrainer(event_t event)
LcdFlags attr;
LcdFlags blink = ((s_editMode>0) ? BLINK|INVERS : INVERS);

lcdDrawText(5*FW, MENU_HEADER_HEIGHT+1, STR_MODE);
lcdDrawText(11*FW, MENU_HEADER_HEIGHT+1, "%", RIGHT);
lcdDrawText(12*FW, MENU_HEADER_HEIGHT+1, STR_SOURCE);
lcdDrawText(COL_TWO, MENU_HEADER_HEIGHT + 1, STR_MODE);
lcdDrawText(COL_THREE, MENU_HEADER_HEIGHT + 1, "%", RIGHT);
lcdDrawText(COL_FOUR, MENU_HEADER_HEIGHT + 1, STR_SOURCE);

y = MENU_HEADER_HEIGHT + 1 + FH;

Expand All @@ -60,18 +65,19 @@ void menuRadioTrainer(event_t event)

switch (j) {
case 0:
lcdDrawTextAtIndex(5*FW, y, STR_TRNMODE, td->mode, attr);
if (attr&BLINK) CHECK_INCDEC_GENVAR(event, td->mode, 0, 2);
lcdDrawTextAtIndex(COL_TWO, y, STR_TRNMODE, td->mode, attr);
if (attr & BLINK) CHECK_INCDEC_GENVAR(event, td->mode, 0, 2);
break;

case 1:
lcdDrawNumber(11*FW, y, td->studWeight, attr|RIGHT);
if (attr&BLINK) CHECK_INCDEC_GENVAR(event, td->studWeight, -125, 125);
lcdDrawNumber(COL_THREE, y, td->studWeight, attr | RIGHT);
if (attr & BLINK)
CHECK_INCDEC_GENVAR(event, td->studWeight, -125, 125);
break;

case 2:
lcdDrawTextAtIndex(12*FW, y, STR_TRNCHN, td->srcChn, attr);
if (attr&BLINK) CHECK_INCDEC_GENVAR(event, td->srcChn, 0, 3);
lcdDrawTextAtIndex(COL_FOUR, y, STR_TRNCHN, td->srcChn, attr);
if (attr & BLINK) CHECK_INCDEC_GENVAR(event, td->srcChn, 0, 3);
break;
}
}
Expand Down

0 comments on commit d1a3afc

Please sign in to comment.