Browse Source

Adjustment to DOG_CHAR_*_EDIT

pull/1/head
Scott Lahteine 7 years ago
parent
commit
38d62494ef
  1. 16
      Marlin/src/lcd/ultralcd_impl_DOGM.h

16
Marlin/src/lcd/ultralcd_impl_DOGM.h

@ -143,13 +143,11 @@
#if ENABLED(USE_BIG_EDIT_FONT) #if ENABLED(USE_BIG_EDIT_FONT)
#define FONT_MENU_EDIT_NAME u8g_font_9x18 #define FONT_MENU_EDIT_NAME u8g_font_9x18
#define DOG_CHAR_WIDTH_EDIT 9 #define DOG_CHAR_WIDTH_EDIT 9
#define DOG_CHAR_HEIGHT_EDIT 13 #define DOG_CHAR_HEIGHT_EDIT 18
#define LCD_WIDTH_EDIT 14
#else #else
#define FONT_MENU_EDIT_NAME FONT_MENU_NAME #define FONT_MENU_EDIT_NAME FONT_MENU_NAME
#define DOG_CHAR_WIDTH_EDIT 6 #define DOG_CHAR_WIDTH_EDIT DOG_CHAR_WIDTH
#define DOG_CHAR_HEIGHT_EDIT 12 #define DOG_CHAR_HEIGHT_EDIT DOG_CHAR_HEIGHT
#define LCD_WIDTH_EDIT 22
#endif #endif
#ifndef TALL_FONT_CORRECTION #ifndef TALL_FONT_CORRECTION
@ -935,13 +933,15 @@ static void lcd_implementation_status_screen() {
const uint8_t labellen = lcd_strlen_P(pstr), const uint8_t labellen = lcd_strlen_P(pstr),
vallen = lcd_strlen(value); vallen = lcd_strlen(value);
constexpr uint8_t lcd_width_edit = (LCD_WIDTH) / (DOG_CHAR_WIDTH_EDIT);
uint8_t rows = (labellen > LCD_WIDTH - 2 - vallen) ? 2 : 1; uint8_t rows = (labellen > LCD_WIDTH - 2 - vallen) ? 2 : 1;
#if ENABLED(USE_BIG_EDIT_FONT) #if ENABLED(USE_BIG_EDIT_FONT)
uint8_t lcd_width, char_width; uint8_t lcd_width, char_width;
if (labellen <= LCD_WIDTH_EDIT - 1) { if (labellen <= lcd_width_edit - 1) {
if (labellen + vallen + 2 >= LCD_WIDTH_EDIT) rows = 2; if (labellen + vallen + 2 >= lcd_width_edit) rows = 2;
lcd_width = LCD_WIDTH_EDIT + 1; lcd_width = lcd_width_edit + 1;
char_width = DOG_CHAR_WIDTH_EDIT; char_width = DOG_CHAR_WIDTH_EDIT;
lcd_setFont(FONT_MENU_EDIT); lcd_setFont(FONT_MENU_EDIT);
} }

Loading…
Cancel
Save