Ver código fonte

Space-separate scrolling Status Message (#21523)

Co-authored-by: Scott Lahteine <github@thinkyhead.com>
XDA-Bam 4 anos atrás
pai
commit
cc5297d637
Nenhuma conta vinculada ao e-mail do autor do commit

+ 8
- 5
Marlin/src/lcd/HD44780/marlinui_HD44780.cpp Ver arquivo

684
 
684
 
685
       // If the remaining string doesn't completely fill the screen
685
       // If the remaining string doesn't completely fill the screen
686
       if (rlen < LCD_WIDTH) {
686
       if (rlen < LCD_WIDTH) {
687
-        lcd_put_wchar('.');                   // Always at 1+ spaces left, draw a dot
688
         uint8_t chars = LCD_WIDTH - rlen;     // Amount of space left in characters
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
       if (last_blink != blink) {
698
       if (last_blink != blink) {

+ 8
- 5
Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp Ver arquivo

581
 
581
 
582
       // If the remaining string doesn't completely fill the screen
582
       // If the remaining string doesn't completely fill the screen
583
       if (rlen < LCD_WIDTH) {
583
       if (rlen < LCD_WIDTH) {
584
-        lcd.write('.');                       // Always at 1+ spaces left, draw a dot
585
         uint8_t chars = LCD_WIDTH - rlen;     // Amount of space left in characters
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
       if (last_blink != blink) {
595
       if (last_blink != blink) {

+ 8
- 5
Marlin/src/lcd/dogm/status_screen_DOGM.cpp Ver arquivo

959
 
959
 
960
       // If the remaining string doesn't completely fill the screen
960
       // If the remaining string doesn't completely fill the screen
961
       if (rlen < lcd_width) {
961
       if (rlen < lcd_width) {
962
-        lcd_put_wchar('.');                     // Always at 1+ spaces left, draw a dot
963
         uint8_t chars = lcd_width - rlen;       // Amount of space left in characters
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
             lcd_put_wchar(' ');
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 Ver arquivo

642
 
642
 
643
       // If the remaining string doesn't completely fill the screen
643
       // If the remaining string doesn't completely fill the screen
644
       if (rlen < TEXT_MODE_LCD_WIDTH) {
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
       ui.advance_status_scroll();
655
       ui.advance_status_scroll();

Carregando…
Cancelar
Salvar