Просмотр исходного кода

Space-separate scrolling Status Message (#21523)

Co-authored-by: Scott Lahteine <github@thinkyhead.com>
XDA-Bam 3 лет назад
Родитель
Сommit
cc5297d637
Аккаунт пользователя с таким Email не найден

+ 8
- 5
Marlin/src/lcd/HD44780/marlinui_HD44780.cpp Просмотреть файл

@@ -684,12 +684,15 @@ void MarlinUI::draw_status_message(const bool blink) {
684 684
 
685 685
       // If the remaining string doesn't completely fill the screen
686 686
       if (rlen < LCD_WIDTH) {
687
-        lcd_put_wchar('.');                   // Always at 1+ spaces left, draw a dot
688 687
         uint8_t chars = LCD_WIDTH - rlen;     // Amount of space left in characters
689
-        if (--chars) {                        // Draw a second dot if there's space
690
-          lcd_put_wchar('.');
691
-          if (--chars)
692
-            lcd_put_u8str_max(status_message, chars); // Print a second copy of the message
688
+        lcd_put_wchar(' ');                   // Always at 1+ spaces left, draw a space
689
+        if (--chars) {                        // Draw a second space if there's room
690
+          lcd_put_wchar(' ');
691
+          if (--chars) {                      // Draw a third space if there's room
692
+            lcd_put_wchar(' ');
693
+            if (--chars)
694
+              lcd_put_u8str_max(status_message, chars); // Print a second copy of the message
695
+          }
693 696
         }
694 697
       }
695 698
       if (last_blink != blink) {

+ 8
- 5
Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp Просмотреть файл

@@ -581,12 +581,15 @@ void MarlinUI::draw_status_message(const bool blink) {
581 581
 
582 582
       // If the remaining string doesn't completely fill the screen
583 583
       if (rlen < LCD_WIDTH) {
584
-        lcd.write('.');                       // Always at 1+ spaces left, draw a dot
585 584
         uint8_t chars = LCD_WIDTH - rlen;     // Amount of space left in characters
586
-        if (--chars) {                        // Draw a second dot if there's space
587
-          lcd.write('.');
588
-          if (--chars)
589
-            lcd_put_u8str_max(status_message, chars); // Print a second copy of the message
585
+        lcd.write(' ');                       // Always at 1+ spaces left, draw a space
586
+        if (--chars) {                        // Draw a second space if there's room
587
+          lcd.write(' ');
588
+          if (--chars) {                      // Draw a third space if there's room
589
+            lcd.write(' ');
590
+            if (--chars)
591
+              lcd_put_u8str_max(status_message, chars); // Print a second copy of the message
592
+          }
590 593
         }
591 594
       }
592 595
       if (last_blink != blink) {

+ 8
- 5
Marlin/src/lcd/dogm/status_screen_DOGM.cpp Просмотреть файл

@@ -959,13 +959,16 @@ void MarlinUI::draw_status_message(const bool blink) {
959 959
 
960 960
       // If the remaining string doesn't completely fill the screen
961 961
       if (rlen < lcd_width) {
962
-        lcd_put_wchar('.');                     // Always at 1+ spaces left, draw a dot
963 962
         uint8_t chars = lcd_width - rlen;       // Amount of space left in characters
964
-        if (--chars) {                          // Draw a second dot if there's space
965
-          lcd_put_wchar('.');
966
-          if (--chars) {                        // Print a second copy of the message
967
-            lcd_put_u8str_max(status_message, pixel_width - (rlen + 2) * (MENU_FONT_WIDTH));
963
+        lcd_put_wchar(' ');                     // Always at 1+ spaces left, draw a space
964
+        if (--chars) {                          // Draw a second space if there's room
965
+          lcd_put_wchar(' ');
966
+          if (--chars) {                        // Draw a third space if there's room
968 967
             lcd_put_wchar(' ');
968
+            if (--chars) {                      // Print a second copy of the message
969
+              lcd_put_u8str_max(status_message, pixel_width - (rlen + 2) * (MENU_FONT_WIDTH));
970
+              lcd_put_wchar(' ');
971
+            }
969 972
           }
970 973
         }
971 974
       }

+ 8
- 5
Marlin/src/lcd/dogm/status_screen_lite_ST7920.cpp Просмотреть файл

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

Загрузка…
Отмена
Сохранить