1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-25 17:25:13 +03:00

Taranis main view adjustments for 3-char switch names (fix #3278)

This commit is contained in:
Andre Bernet 2016-02-07 15:44:20 +04:00
parent 110c5da1e7
commit afddad9396

View file

@ -22,8 +22,8 @@
#include "../../timers.h" #include "../../timers.h"
#define BIGSIZE MIDSIZE #define BIGSIZE MIDSIZE
#define LBOX_CENTERX (BOX_WIDTH/2 + 17) #define LBOX_CENTERX (BOX_WIDTH/2 + 16)
#define RBOX_CENTERX (LCD_W-LBOX_CENTERX) #define RBOX_CENTERX (LCD_W-LBOX_CENTERX-1)
#define MODELNAME_X (15) #define MODELNAME_X (15)
#define MODELNAME_Y (11) #define MODELNAME_Y (11)
#define VBATT_X (MODELNAME_X+26) #define VBATT_X (MODELNAME_X+26)
@ -522,12 +522,12 @@ void menuMainView(uint8_t event)
if (g_eeGeneral.view == VIEW_INPUTS) { if (g_eeGeneral.view == VIEW_INPUTS) {
div_t qr2 = div(qr.rem, 5); div_t qr2 = div(qr.rem, 5);
if (i >= 14) qr2.rem += 1; if (i >= 14) qr2.rem += 1;
const coord_t x[4] = { 50, 144 }; const coord_t x[4] = { 50, 142 };
const coord_t y[4] = { 25, 42, 25, 42 }; const coord_t y[4] = { 25, 42, 25, 42 };
displaySwitch(x[qr.quot]+qr2.rem*4, y[qr2.quot], 3, i); displaySwitch(x[qr.quot]+qr2.rem*4, y[qr2.quot], 3, i);
} }
else { else {
displaySwitch(15+qr.rem*6, 25+qr.quot*17, 5, i); displaySwitch(17+qr.rem*6, 25+qr.quot*17, 5, i);
} }
} }
} }
@ -537,7 +537,7 @@ void menuMainView(uint8_t event)
if (SWITCH_EXISTS(i)) { if (SWITCH_EXISTS(i)) {
getvalue_t val = getValue(MIXSRC_FIRST_SWITCH+i); getvalue_t val = getValue(MIXSRC_FIRST_SWITCH+i);
getvalue_t sw = ((val < 0) ? 3*i+1 : ((val == 0) ? 3*i+2 : 3*i+3)); getvalue_t sw = ((val < 0) ? 3*i+1 : ((val == 0) ? 3*i+2 : 3*i+3));
putsSwitches((g_eeGeneral.view == VIEW_INPUTS) ? (index<4 ? 8*FW+3 : 24*FW+1) : (index<4 ? 3*FW+2 : 8*FW-1), (index%4)*FH+3*FH, sw, 0); putsSwitches((g_eeGeneral.view == VIEW_INPUTS) ? (index<4 ? 8*FW+1 : 23*FW+2) : (index<4 ? 3*FW+1 : 8*FW-2), (index%4)*FH+3*FH, sw, 0);
index++; index++;
} }
} }