3djc/x7 mixer screen rework (#4281)

* Optimise display on 128x64

* Name if present are displayed (like now), but when the row is selected, the name moves on top and the display alternates between FM and other info

* Compile fix
This commit is contained in:
3djc
2017-01-24 18:25:38 +01:00
committed by Bertrand Songis
parent 36928b7b60
commit aa19475c90
+25 -13
View File
@@ -195,12 +195,12 @@ void displayMixLine(coord_t y, MixData * md)
cs = (cs == 'S' ? '*' : 'D');
lcdDrawChar(MIX_LINE_DELAY_POS, y, cs);
}
#else
#else // LCD_W >= 212
#define MIX_LINE_WEIGHT_POS 6*FW+8
#define MIX_LINE_SRC_POS 7*FW+3
#define MIX_LINE_CURVE_POS 12*FW
#define MIX_LINE_SWITCH_POS 16*FW+4
#define MIX_LINE_FM_POS 13*FW+3
#define MIX_LINE_CURVE_POS 12*FW+3
#define MIX_LINE_SWITCH_POS 16*FW+5
#define MIX_LINE_FM_POS 19*FW
#define MIX_LINE_DELAY_POS 20*FW+2
#define MIX_LINE_NAME_POS LCD_W-LEN_EXPOMIX_NAME*FW
@@ -228,16 +228,25 @@ void displayMixInfos(coord_t y, MixData * md)
lcdDrawChar(MIX_LINE_DELAY_POS, y, cs);
}
void displayMixLine(coord_t y, MixData * md)
void displayMixLine(coord_t y, MixData * md, bool active)
{
if (md->name[0])
lcdDrawSizedText(MIX_LINE_NAME_POS, y, md->name, sizeof(md->name), ZCHAR);
else if (!md->flightModes || ((md->curve.value || md->swtch) && ((get_tmr10ms() / 200) & 1)))
displayMixInfos(y, md);
else
displayFlightModes(MIX_LINE_FM_POS, y, md->flightModes);
if(active && md->name[0]) {
lcdDrawSizedText(FW*sizeof(TR_MIXER), 0, md->name, sizeof(md->name), ZCHAR);
if (!md->flightModes || ((md->curve.value || md->swtch) && ((get_tmr10ms() / 200) & 1)))
displayMixInfos(y, md);
else
displayFlightModes(MIX_LINE_FM_POS, y, md->flightModes);
}
else {
if (md->name[0])
lcdDrawSizedText(MIX_LINE_NAME_POS, y, md->name, sizeof(md->name), ZCHAR);
else if (!md->flightModes || ((md->curve.value || md->swtch) && ((get_tmr10ms() / 200) & 1)))
displayMixInfos(y, md);
else
displayFlightModes(MIX_LINE_FM_POS, y, md->flightModes);
}
}
#endif
#endif // LCD_W >= 212
void menuModelMixAll(event_t event)
{
@@ -433,8 +442,11 @@ void menuModelMixAll(event_t event)
drawSource(MIX_LINE_SRC_POS, y, md->srcRaw, 0);
gvarWeightItem(MIX_LINE_WEIGHT_POS, y, md, RIGHT | attr | (isMixActive(i) ? BOLD : 0), 0);
#if LCD_W >= 212
displayMixLine(y, md);
#else
displayMixLine(y, md, (sub == cur));
#endif
if (s_copyMode) {
if ((s_copyMode==COPY_MODE || s_copyTgtOfs == 0) && s_copySrcCh == ch && i == (s_copySrcIdx + (s_copyTgtOfs<0))) {