|
@ -612,31 +612,24 @@ void MarlinUI::draw_status_message(const bool blink) { |
|
|
if (slen <= LCD_WIDTH) { |
|
|
if (slen <= LCD_WIDTH) { |
|
|
// The string fits within the line. Print with no scrolling
|
|
|
// The string fits within the line. Print with no scrolling
|
|
|
lcd_put_u8str(status_message); |
|
|
lcd_put_u8str(status_message); |
|
|
for (; slen < LCD_WIDTH; ++slen) lcd_put_wchar(' '); |
|
|
while (slen < LCD_WIDTH) { lcd_put_wchar(' '); ++slen; } |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
// String is longer than the available space
|
|
|
// String is longer than the available space
|
|
|
|
|
|
|
|
|
// Get a pointer to the next valid UTF8 character
|
|
|
// Get a pointer to the next valid UTF8 character
|
|
|
const char *stat = status_message + status_scroll_offset; |
|
|
// and the string remaining length
|
|
|
|
|
|
uint8_t rlen; |
|
|
// Get the string remaining length
|
|
|
const char *stat = status_and_len(rlen); |
|
|
const uint8_t rlen = utf8_strlen(stat); |
|
|
lcd_put_u8str_max(stat, LCD_PIXEL_WIDTH); |
|
|
|
|
|
|
|
|
if (rlen >= LCD_WIDTH) { |
|
|
// If the remaining string doesn't completely fill the screen
|
|
|
// The remaining string fills the screen - Print it
|
|
|
if (rlen < LCD_WIDTH) { |
|
|
lcd_put_u8str_max(stat, LCD_PIXEL_WIDTH); |
|
|
lcd_put_wchar('.'); // Always at 1+ spaces left, draw a dot
|
|
|
} |
|
|
uint8_t chars = LCD_WIDTH - rlen; // Amount of space left in characters
|
|
|
else { |
|
|
if (--chars) { // Draw a second dot if there's space
|
|
|
// The remaining string does not completely fill the screen
|
|
|
|
|
|
lcd_put_u8str_max(stat, LCD_PIXEL_WIDTH); // The string leaves space
|
|
|
|
|
|
uint8_t chars = LCD_WIDTH - rlen; // Amount of space left in characters
|
|
|
|
|
|
|
|
|
|
|
|
lcd_put_wchar('.'); // Always at 1+ spaces left, draw a dot
|
|
|
|
|
|
if (--chars) { // Draw a second dot if there's space
|
|
|
|
|
|
lcd_put_wchar('.'); |
|
|
lcd_put_wchar('.'); |
|
|
if (--chars) { |
|
|
if (--chars) { // Print a second copy of the message
|
|
|
// Print a second copy of the message
|
|
|
|
|
|
lcd_put_u8str_max(status_message, LCD_PIXEL_WIDTH - (rlen + 2) * (MENU_FONT_WIDTH)); |
|
|
lcd_put_u8str_max(status_message, LCD_PIXEL_WIDTH - (rlen + 2) * (MENU_FONT_WIDTH)); |
|
|
lcd_put_wchar(' '); |
|
|
lcd_put_wchar(' '); |
|
|
} |
|
|
} |
|
@ -644,15 +637,7 @@ void MarlinUI::draw_status_message(const bool blink) { |
|
|
} |
|
|
} |
|
|
if (last_blink != blink) { |
|
|
if (last_blink != blink) { |
|
|
last_blink = blink; |
|
|
last_blink = blink; |
|
|
|
|
|
advance_status_scroll(); |
|
|
// Adjust by complete UTF8 characters
|
|
|
|
|
|
if (status_scroll_offset < slen) { |
|
|
|
|
|
status_scroll_offset++; |
|
|
|
|
|
while (!START_OF_UTF8_CHAR(status_message[status_scroll_offset])) |
|
|
|
|
|
status_scroll_offset++; |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
status_scroll_offset = 0; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|