Fix and improve LCD value editing display
- Fix: When "100.0" changes to "99.0" the LCD shows "199.0" - Use 2 rows if needed on character LCD, (allowing longer labels… Germany, et. al.) - Known issue: A certain length label combined with a certain value drawing function could, for example, display 99.0 on 1 line, but 100.0 on two lines. Workaround would be to pass a nominal value size argument.
This commit is contained in:
@ -978,7 +978,9 @@ static void lcd_implementation_status_screen() {
|
||||
lcd_printPGM(pstr);
|
||||
if (value != NULL) {
|
||||
lcd.print(':');
|
||||
lcd.setCursor(LCD_WIDTH - lcd_strlen(value), 1);
|
||||
const uint8_t valrow = (lcd_strlen_P(pstr) + 1 + lcd_strlen(value) + 1) > (LCD_WIDTH - 2) ? 2 : 1; // Value on the next row if it won't fit
|
||||
lcd.setCursor((LCD_WIDTH - 1) - (lcd_strlen(value) + 1), valrow); // Right-justified, padded by spaces
|
||||
lcd.print(' '); // overwrite char if value gets shorter
|
||||
lcd_print(value);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user