Browse Source

Shorter LCD remaining time to prevent overlap (#17181)

Pascal de Bruijn 5 years ago
parent
commit
2fc0df1b39
No account linked to committer's email address
1 changed files with 3 additions and 4 deletions
  1. 3
    4
      Marlin/src/lcd/dogm/status_screen_DOGM.cpp

+ 3
- 4
Marlin/src/lcd/dogm/status_screen_DOGM.cpp View File

448
         #endif
448
         #endif
449
       }
449
       }
450
 
450
 
451
+      constexpr bool can_show_days = DISABLED(DOGM_SD_PERCENT) || ENABLED(ROTATE_PROGRESS_DISPLAY);
451
       if (ev != lastElapsed) {
452
       if (ev != lastElapsed) {
452
         lastElapsed = ev;
453
         lastElapsed = ev;
453
-        const bool has_days = (elapsed.value >= 60*60*24L);
454
-        const uint8_t len = elapsed.toDigital(elapsed_string, has_days);
454
+        const uint8_t len = elapsed.toDigital(elapsed_string, can_show_days && elapsed.value >= 60*60*24L);
455
         elapsed_x_pos = _SD_INFO_X(len);
455
         elapsed_x_pos = _SD_INFO_X(len);
456
 
456
 
457
         #if ENABLED(SHOW_REMAINING_TIME)
457
         #if ENABLED(SHOW_REMAINING_TIME)
468
             }
468
             }
469
             else {
469
             else {
470
               duration_t estimation = timeval;
470
               duration_t estimation = timeval;
471
-              const bool has_days = (estimation.value >= 60*60*24L);
472
-              const uint8_t len = estimation.toDigital(estimation_string, has_days);
471
+              const uint8_t len = estimation.toDigital(estimation_string, can_show_days && estimation.value >= 60*60*24L);
473
               estimation_x_pos = _SD_INFO_X(len
472
               estimation_x_pos = _SD_INFO_X(len
474
                 #if !BOTH(DOGM_SD_PERCENT, ROTATE_PROGRESS_DISPLAY)
473
                 #if !BOTH(DOGM_SD_PERCENT, ROTATE_PROGRESS_DISPLAY)
475
                   + 1
474
                   + 1

Loading…
Cancel
Save