|
@@ -452,8 +452,14 @@ static void lcd_implementation_status_screen() {
|
452
|
452
|
// Progress bar frame
|
453
|
453
|
//
|
454
|
454
|
|
455
|
|
- if (PAGE_CONTAINS(49, 52 - (TALL_FONT_CORRECTION)))
|
456
|
|
- u8g.drawFrame(54, 49, 73, 4 - (TALL_FONT_CORRECTION)); // 49-52 (or 49-51)
|
|
455
|
+ #define PROGRESS_BAR_X 54
|
|
456
|
+ #define PROGRESS_BAR_WIDTH (LCD_PIXEL_WIDTH - PROGRESS_BAR_X)
|
|
457
|
+
|
|
458
|
+ if (PAGE_CONTAINS(49, 52 - (TALL_FONT_CORRECTION))) // 49-52 (or 49-51)
|
|
459
|
+ u8g.drawFrame(
|
|
460
|
+ PROGRESS_BAR_X, 49,
|
|
461
|
+ PROGRESS_BAR_WIDTH, 4 - (TALL_FONT_CORRECTION)
|
|
462
|
+ );
|
457
|
463
|
|
458
|
464
|
if (IS_SD_PRINTING) {
|
459
|
465
|
|
|
@@ -461,8 +467,11 @@ static void lcd_implementation_status_screen() {
|
461
|
467
|
// Progress bar solid part
|
462
|
468
|
//
|
463
|
469
|
|
464
|
|
- if (PAGE_CONTAINS(50, 51 - (TALL_FONT_CORRECTION)))
|
465
|
|
- u8g.drawBox(55, 50, (unsigned int)(71 * card.percentDone() * 0.01), 2 - (TALL_FONT_CORRECTION));
|
|
470
|
+ if (PAGE_CONTAINS(50, 51 - (TALL_FONT_CORRECTION))) // 50-51 (or just 50)
|
|
471
|
+ u8g.drawBox(
|
|
472
|
+ PROGRESS_BAR_X + 1, 50,
|
|
473
|
+ (unsigned int)((PROGRESS_BAR_WIDTH - 2) * card.percentDone() * 0.01), 2 - (TALL_FONT_CORRECTION)
|
|
474
|
+ );
|
466
|
475
|
|
467
|
476
|
//
|
468
|
477
|
// SD Percent Complete
|
|
@@ -483,9 +492,9 @@ static void lcd_implementation_status_screen() {
|
483
|
492
|
//
|
484
|
493
|
|
485
|
494
|
#if DISABLED(DOGM_SD_PERCENT)
|
486
|
|
- #define SD_DURATION_X 71
|
|
495
|
+ #define SD_DURATION_X (PROGRESS_BAR_X + (PROGRESS_BAR_WIDTH / 2) - len * (DOG_CHAR_WIDTH / 2))
|
487
|
496
|
#else
|
488
|
|
- #define SD_DURATION_X 89
|
|
497
|
+ #define SD_DURATION_X (LCD_PIXEL_WIDTH - len * DOG_CHAR_WIDTH)
|
489
|
498
|
#endif
|
490
|
499
|
|
491
|
500
|
if (PAGE_CONTAINS(41, 48)) {
|
|
@@ -493,9 +502,8 @@ static void lcd_implementation_status_screen() {
|
493
|
502
|
char buffer[10];
|
494
|
503
|
duration_t elapsed = print_job_timer.duration();
|
495
|
504
|
bool has_days = (elapsed.value > 60*60*24L);
|
496
|
|
- elapsed.toDigital(buffer, has_days);
|
497
|
|
-
|
498
|
|
- u8g.setPrintPos(SD_DURATION_X + (has_days ? 0 : 9), 48);
|
|
505
|
+ uint8_t len = elapsed.toDigital(buffer, has_days);
|
|
506
|
+ u8g.setPrintPos(SD_DURATION_X, 48);
|
499
|
507
|
lcd_print(buffer);
|
500
|
508
|
}
|
501
|
509
|
|
|
@@ -749,11 +757,12 @@ static void lcd_implementation_status_screen() {
|
749
|
757
|
#define lcd_implementation_drawmenu_setting_edit_callback_bool(sel, row, pstr, pstr2, data, callback) lcd_implementation_drawmenu_setting_edit_generic_P(sel, row, pstr, (*(data))?PSTR(MSG_ON):PSTR(MSG_OFF))
|
750
|
758
|
|
751
|
759
|
void lcd_implementation_drawedit(const char* const pstr, const char* const value=NULL) {
|
752
|
|
- const uint8_t labellen = lcd_strlen_P(pstr), vallen = lcd_strlen(value);
|
753
|
|
- uint8_t lcd_width, char_width,
|
754
|
|
- rows = (labellen > LCD_WIDTH - 2 - vallen) ? 2 : 1;
|
|
760
|
+ const uint8_t labellen = lcd_strlen_P(pstr),
|
|
761
|
+ vallen = lcd_strlen(value),
|
|
762
|
+ rows = (labellen > LCD_WIDTH - 2 - vallen) ? 2 : 1;
|
755
|
763
|
|
756
|
764
|
#if ENABLED(USE_BIG_EDIT_FONT)
|
|
765
|
+ uint8_t lcd_width, char_width;
|
757
|
766
|
if (labellen <= LCD_WIDTH_EDIT - 1) {
|
758
|
767
|
if (labellen >= LCD_WIDTH_EDIT - vallen) rows = 2;
|
759
|
768
|
lcd_width = LCD_WIDTH_EDIT + 1;
|
|
@@ -766,8 +775,8 @@ static void lcd_implementation_status_screen() {
|
766
|
775
|
lcd_setFont(FONT_MENU);
|
767
|
776
|
}
|
768
|
777
|
#else
|
769
|
|
- lcd_width = LCD_WIDTH - (START_COL);
|
770
|
|
- char_width = DOG_CHAR_WIDTH;
|
|
778
|
+ constexpr uint8_t lcd_width = LCD_WIDTH - (START_COL),
|
|
779
|
+ char_width = DOG_CHAR_WIDTH;
|
771
|
780
|
#endif
|
772
|
781
|
|
773
|
782
|
// Center either one or two rows
|