Space-separate scrolling Status Message (#21523)

Co-authored-by: Scott Lahteine <github@thinkyhead.com>
This commit is contained in:
XDA-Bam
2021-04-14 11:42:04 +02:00
committed by GitHub
parent 1595fdb54b
commit cc5297d637
4 changed files with 32 additions and 20 deletions

View File

@@ -642,11 +642,14 @@ void ST7920_Lite_Status_Screen::draw_status_message() {
// If the remaining string doesn't completely fill the screen
if (rlen < TEXT_MODE_LCD_WIDTH) {
write_byte('.'); // Always at 1+ spaces left, draw a dot
uint8_t chars = TEXT_MODE_LCD_WIDTH - rlen; // Amount of space left in characters
if (--chars) { // Draw a second dot if there's space
write_byte('.');
if (--chars) write_str(str, chars); // Print a second copy of the message
uint8_t chars = TEXT_MODE_LCD_WIDTH - rlen; // Amount of space left in characters
write_byte(' '); // Always at 1+ spaces left, draw a space
if (--chars) { // Draw a second space if there's room
write_byte(' ');
if (--chars) { // Draw a third space if there's room
write_byte(' ');
if (--chars) write_str(str, chars); // Print a second copy of the message
}
}
}
ui.advance_status_scroll();