1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-18 22:05:10 +03:00

FIXEDWIDTH flag

Editing fields are now in FIXED mode to show its real width on LCD.
TODO: font bitmaps have to be altered to center shorter characters to the center of the field.
This commit is contained in:
mhotar 2014-01-05 10:56:17 +01:00
parent b90a621db8
commit 32c16f9f28
4 changed files with 17 additions and 6 deletions

View file

@ -768,7 +768,12 @@ void editName(uint8_t x, uint8_t y, char *name, uint8_t size, uint8_t event, uin
lcd_putsLeft(y, STR_NAME);
#endif
lcd_putsnAtt(x, y, name, size, ZCHAR | ((active && s_editMode <= 0) ? INVERS : 0));
uint8_t mode = 0;
if (active) {
if (s_editMode <= 0) mode = INVERS+FIXEDWIDTH;
else mode = FIXEDWIDTH;
}
lcd_putsnAtt(x, y, name, size, ZCHAR | mode);
if (active) {
uint8_t cur = editNameCursorPos;
@ -831,8 +836,9 @@ void editName(uint8_t x, uint8_t y, char *name, uint8_t size, uint8_t event, uin
name[cur] = v;
eeDirty(EE_MODEL);
}
lcd_putsnAtt(x, y, name, editNameCursorPos, ZCHAR | ((active && s_editMode <= 0) ? INVERS : 0));
lcd_putcAtt(lcdLastPos, y, idx2char(v), INVERS);
lcd_putcAtt(x+editNameCursorPos*FW, y, idx2char(v), INVERS+FIXEDWIDTH);
// lcd_putsnAtt(x, y, name, editNameCursorPos, ZCHAR);
// lcd_putcAtt(lcdLastPos, y, idx2char(v), INVERS);
}
else {
cur = 0;