Browse Source

Fix up STATIC_ITEM (#18962)

Scott Lahteine 5 years ago
parent
commit
c2d5b63a98
No account linked to committer's email address

+ 1
- 1
Marlin/src/feature/powerloss.cpp View File

21
  */
21
  */
22
 
22
 
23
 /**
23
 /**
24
- * power_loss_recovery.cpp - Resume an SD print after power-loss
24
+ * feature/powerloss.cpp - Resume an SD print after power-loss
25
  */
25
  */
26
 
26
 
27
 #include "../inc/MarlinConfigPre.h"
27
 #include "../inc/MarlinConfigPre.h"

+ 1
- 1
Marlin/src/feature/powerloss.h View File

22
 #pragma once
22
 #pragma once
23
 
23
 
24
 /**
24
 /**
25
- * power_loss_recovery.h - Resume an SD print after power-loss
25
+ * feature/powerloss.h - Resume an SD print after power-loss
26
  */
26
  */
27
 
27
 
28
 #include "../sd/cardreader.h"
28
 #include "../sd/cardreader.h"

+ 7
- 5
Marlin/src/lcd/HD44780/ultralcd_HD44780.cpp View File

997
   #endif // ADVANCED_PAUSE_FEATURE
997
   #endif // ADVANCED_PAUSE_FEATURE
998
 
998
 
999
   // Draw a static item with no left-right margin required. Centered by default.
999
   // Draw a static item with no left-right margin required. Centered by default.
1000
-  void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_DEFAULT*/, const char * const valstr/*=nullptr*/) {
1000
+  void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) {
1001
     int8_t n = LCD_WIDTH;
1001
     int8_t n = LCD_WIDTH;
1002
     lcd_moveto(0, row);
1002
     lcd_moveto(0, row);
1003
-    if ((style & SS_CENTER) && !valstr) {
1004
-      int8_t pad = (LCD_WIDTH - utf8_strlen_P(pstr)) / 2;
1003
+    const int8_t plen = pstr ? utf8_strlen_P(pstr) : 0,
1004
+                 vlen = vstr ? utf8_strlen(vstr) : 0;
1005
+    if (style & SS_CENTER) {
1006
+      int8_t pad = (LCD_WIDTH - plen - vlen) / 2;
1005
       while (--pad >= 0) { lcd_put_wchar(' '); n--; }
1007
       while (--pad >= 0) { lcd_put_wchar(' '); n--; }
1006
     }
1008
     }
1007
-    n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, n);
1008
-    if (valstr) n -= lcd_put_u8str_max(valstr, n);
1009
+    if (plen) n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, n);
1010
+    if (vlen) n -= lcd_put_u8str_max(vstr, n);
1009
     for (; n > 0; --n) lcd_put_wchar(' ');
1011
     for (; n > 0; --n) lcd_put_wchar(' ');
1010
   }
1012
   }
1011
 
1013
 

+ 9
- 8
Marlin/src/lcd/dogm/ultralcd_DOGM.cpp View File

347
   }
347
   }
348
 
348
 
349
   // Draw a static line of text in the same idiom as a menu item
349
   // Draw a static line of text in the same idiom as a menu item
350
-  void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_DEFAULT*/, const char * const valstr/*=nullptr*/) {
350
+  void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) {
351
 
351
 
352
     if (mark_as_selected(row, style & SS_INVERT)) {
352
     if (mark_as_selected(row, style & SS_INVERT)) {
353
 
353
 
354
       pixel_len_t n = LCD_PIXEL_WIDTH; // pixel width of string allowed
354
       pixel_len_t n = LCD_PIXEL_WIDTH; // pixel width of string allowed
355
 
355
 
356
-      if ((style & SS_CENTER) && !valstr)
357
-        for (int8_t pad = (LCD_WIDTH - utf8_strlen_P(pstr)) / 2; pad > 0; --pad) {
358
-          lcd_put_wchar(' ');
359
-          n -= MENU_FONT_WIDTH;
360
-        }
356
+      const int8_t plen = pstr ? utf8_strlen_P(pstr) : 0,
357
+                   vlen = vstr ? utf8_strlen(vstr) : 0;
358
+      if (style & SS_CENTER) {
359
+        int8_t pad = (LCD_WIDTH - plen - vlen) / 2;
360
+        while (--pad >= 0) n -= lcd_put_wchar(' ');
361
+      }
361
 
362
 
362
-      n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, n / (MENU_FONT_WIDTH)) * (MENU_FONT_WIDTH);
363
-      if (valstr) n -= lcd_put_u8str_max(valstr, n);
363
+      if (plen) n = lcd_put_u8str_ind_P(pstr, itemIndex, itemString, n / (MENU_FONT_WIDTH)) * (MENU_FONT_WIDTH);
364
+      if (vlen) n -= lcd_put_u8str_max(vstr, n);
364
       while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' ');
365
       while (n > MENU_FONT_WIDTH) n -= lcd_put_wchar(' ');
365
     }
366
     }
366
   }
367
   }

+ 1
- 1
Marlin/src/lcd/language/language_en.h View File

504
   #if LCD_WIDTH >= 20
504
   #if LCD_WIDTH >= 20
505
     PROGMEM Language_Str MSG_INFO_PRINT_COUNT              = _UxGT("Print Count");
505
     PROGMEM Language_Str MSG_INFO_PRINT_COUNT              = _UxGT("Print Count");
506
     PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS         = _UxGT("Completed");
506
     PROGMEM Language_Str MSG_INFO_COMPLETED_PRINTS         = _UxGT("Completed");
507
-    PROGMEM Language_Str MSG_INFO_PRINT_TIME               = _UxGT("Total Print time");
507
+    PROGMEM Language_Str MSG_INFO_PRINT_TIME               = _UxGT("Total Print Time");
508
     PROGMEM Language_Str MSG_INFO_PRINT_LONGEST            = _UxGT("Longest Job Time");
508
     PROGMEM Language_Str MSG_INFO_PRINT_LONGEST            = _UxGT("Longest Job Time");
509
     PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT           = _UxGT("Extruded Total");
509
     PROGMEM Language_Str MSG_INFO_PRINT_FILAMENT           = _UxGT("Extruded Total");
510
   #else
510
   #else

+ 1
- 0
Marlin/src/lcd/lcdprint.h View File

99
 
99
 
100
 #endif
100
 #endif
101
 
101
 
102
+#define SETCURSOR_X(col) SETCURSOR(col, _lcdLineNr)
102
 #define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80u)
103
 #define START_OF_UTF8_CHAR(C) (((C) & 0xC0u) != 0x80u)
103
 
104
 
104
 int lcd_glyph_height();
105
 int lcd_glyph_height();

+ 11
- 9
Marlin/src/lcd/menu/menu.h View File

83
 
83
 
84
 class MenuItem_static : public MenuItemBase {
84
 class MenuItem_static : public MenuItemBase {
85
   public:
85
   public:
86
-    static void draw(const uint8_t row, PGM_P const pstr, const uint8_t style=SS_DEFAULT, const char * const valstr=nullptr);
86
+    static void draw(const uint8_t row, PGM_P const pstr, const uint8_t style=SS_DEFAULT, const char * const vstr=nullptr);
87
 };
87
 };
88
 
88
 
89
 // CONFIRM_ITEM(LABEL,Y,N,FY,FN,V...),
89
 // CONFIRM_ITEM(LABEL,Y,N,FY,FN,V...),
418
 }while(0)
418
 }while(0)
419
 
419
 
420
 #define _MENU_ITEM_P(TYPE, V...) do { \
420
 #define _MENU_ITEM_P(TYPE, V...) do { \
421
-  _skipStatic = false;                \
422
-  if (_menuLineNr == _thisItemNr)     \
421
+  if (_menuLineNr == _thisItemNr) {   \
422
+    _skipStatic = false;              \
423
     _MENU_INNER_P(TYPE, ##V);         \
423
     _MENU_INNER_P(TYPE, ##V);         \
424
+  }                                   \
424
   NEXT_ITEM();                        \
425
   NEXT_ITEM();                        \
425
 }while(0)
426
 }while(0)
426
 
427
 
427
 // Indexed items set a global index value and optional data
428
 // Indexed items set a global index value and optional data
428
 #define _MENU_ITEM_N_S_P(TYPE, N, S, V...) do{ \
429
 #define _MENU_ITEM_N_S_P(TYPE, N, S, V...) do{ \
429
-  _skipStatic = false;                         \
430
   if (_menuLineNr == _thisItemNr) {            \
430
   if (_menuLineNr == _thisItemNr) {            \
431
+    _skipStatic = false;                       \
431
     MenuItemBase::init(N, S);                  \
432
     MenuItemBase::init(N, S);                  \
432
     _MENU_INNER_P(TYPE, ##V);                  \
433
     _MENU_INNER_P(TYPE, ##V);                  \
433
   }                                            \
434
   }                                            \
436
 
437
 
437
 // Indexed items set a global index value
438
 // Indexed items set a global index value
438
 #define _MENU_ITEM_N_P(TYPE, N, V...) do{ \
439
 #define _MENU_ITEM_N_P(TYPE, N, V...) do{ \
439
-  _skipStatic = false;                    \
440
   if (_menuLineNr == _thisItemNr) {       \
440
   if (_menuLineNr == _thisItemNr) {       \
441
+    _skipStatic = false;                  \
441
     MenuItemBase::itemIndex = N;          \
442
     MenuItemBase::itemIndex = N;          \
442
     _MENU_INNER_P(TYPE, ##V);             \
443
     _MENU_INNER_P(TYPE, ##V);             \
443
   }                                       \
444
   }                                       \
446
 
447
 
447
 // Items with a unique string
448
 // Items with a unique string
448
 #define _MENU_ITEM_S_P(TYPE, S, V...) do{ \
449
 #define _MENU_ITEM_S_P(TYPE, S, V...) do{ \
449
-  _skipStatic = false;                    \
450
   if (_menuLineNr == _thisItemNr) {       \
450
   if (_menuLineNr == _thisItemNr) {       \
451
+    _skipStatic = false;                  \
451
     MenuItemBase::itemString = S;         \
452
     MenuItemBase::itemString = S;         \
452
     _MENU_INNER_P(TYPE, ##V);             \
453
     _MENU_INNER_P(TYPE, ##V);             \
453
   }                                       \
454
   }                                       \
550
 
551
 
551
 // Indexed items set a global index value and optional data
552
 // Indexed items set a global index value and optional data
552
 #define _CONFIRM_ITEM_P(PLABEL, V...) do { \
553
 #define _CONFIRM_ITEM_P(PLABEL, V...) do { \
553
-  _skipStatic = false;                     \
554
-  if (_menuLineNr == _thisItemNr)          \
554
+  if (_menuLineNr == _thisItemNr) {        \
555
+    _skipStatic = false;                   \
555
     _CONFIRM_ITEM_INNER_P(PLABEL, ##V);    \
556
     _CONFIRM_ITEM_INNER_P(PLABEL, ##V);    \
557
+  }                                        \
556
   NEXT_ITEM();                             \
558
   NEXT_ITEM();                             \
557
 }while(0)
559
 }while(0)
558
 
560
 
559
 // Indexed items set a global index value
561
 // Indexed items set a global index value
560
 #define _CONFIRM_ITEM_N_S_P(N, S, V...) do{ \
562
 #define _CONFIRM_ITEM_N_S_P(N, S, V...) do{ \
561
-  _skipStatic = false;                      \
562
   if (_menuLineNr == _thisItemNr) {         \
563
   if (_menuLineNr == _thisItemNr) {         \
564
+    _skipStatic = false;                    \
563
     MenuItemBase::init(N, S);               \
565
     MenuItemBase::init(N, S);               \
564
     _CONFIRM_ITEM_INNER_P(TYPE, ##V);       \
566
     _CONFIRM_ITEM_INNER_P(TYPE, ##V);       \
565
   }                                         \
567
   }                                         \

+ 1
- 1
Marlin/src/lcd/menu/menu_addon.h View File

25
 
25
 
26
 #define MENU_ITEM_ADDON_START(X) do{ \
26
 #define MENU_ITEM_ADDON_START(X) do{ \
27
   if (ui.should_draw() && _menuLineNr == _thisItemNr - 1) { \
27
   if (ui.should_draw() && _menuLineNr == _thisItemNr - 1) { \
28
-    SETCURSOR(X, _lcdLineNr)
28
+    SETCURSOR_X(X)
29
 
29
 
30
 #define MENU_ITEM_ADDON_END() } }while(0)
30
 #define MENU_ITEM_ADDON_END() } }while(0)

+ 2
- 2
Marlin/src/lcd/menu/menu_configuration.cpp View File

66
     bar_percent += (int8_t)ui.encoderPosition;
66
     bar_percent += (int8_t)ui.encoderPosition;
67
     LIMIT(bar_percent, 0, 100);
67
     LIMIT(bar_percent, 0, 100);
68
     ui.encoderPosition = 0;
68
     ui.encoderPosition = 0;
69
-    MenuItem_static::draw(0, GET_TEXT(MSG_PROGRESS_BAR_TEST), SS_CENTER|SS_INVERT);
69
+    MenuItem_static::draw(0, GET_TEXT(MSG_PROGRESS_BAR_TEST), SS_DEFAULT|SS_INVERT);
70
     lcd_put_int((LCD_WIDTH) / 2 - 2, LCD_HEIGHT - 2, bar_percent); lcd_put_wchar('%');
70
     lcd_put_int((LCD_WIDTH) / 2 - 2, LCD_HEIGHT - 2, bar_percent); lcd_put_wchar('%');
71
     lcd_moveto(0, LCD_HEIGHT - 1); ui.draw_progress_bar(bar_percent);
71
     lcd_moveto(0, LCD_HEIGHT - 1); ui.draw_progress_bar(bar_percent);
72
   }
72
   }
307
     #define MAXTEMP_ALL _MAX(REPEAT(HOTENDS, _MAXTEMP_ITEM) 0)
307
     #define MAXTEMP_ALL _MAX(REPEAT(HOTENDS, _MAXTEMP_ITEM) 0)
308
     const uint8_t m = MenuItemBase::itemIndex;
308
     const uint8_t m = MenuItemBase::itemIndex;
309
     START_MENU();
309
     START_MENU();
310
-    STATIC_ITEM_P(ui.get_preheat_label(m), SS_CENTER|SS_INVERT);
310
+    STATIC_ITEM_P(ui.get_preheat_label(m), SS_DEFAULT|SS_INVERT);
311
     BACK_ITEM(MSG_CONFIGURATION);
311
     BACK_ITEM(MSG_CONFIGURATION);
312
     #if HAS_FAN
312
     #if HAS_FAN
313
       editable.uint8 = uint8_t(ui.material_preset[m].fan_speed);
313
       editable.uint8 = uint8_t(ui.material_preset[m].fan_speed);

+ 2
- 2
Marlin/src/lcd/menu/menu_filament.cpp View File

87
   _change_filament_mode = mode;
87
   _change_filament_mode = mode;
88
   _change_filament_extruder = extruder;
88
   _change_filament_extruder = extruder;
89
   START_MENU();
89
   START_MENU();
90
-  if (LCD_HEIGHT >= 4) STATIC_ITEM_P(change_filament_header(mode), SS_CENTER|SS_INVERT);
90
+  if (LCD_HEIGHT >= 4) STATIC_ITEM_P(change_filament_header(mode), SS_DEFAULT|SS_INVERT);
91
   BACK_ITEM(MSG_BACK);
91
   BACK_ITEM(MSG_BACK);
92
   #if PREHEAT_COUNT
92
   #if PREHEAT_COUNT
93
     LOOP_L_N(m, PREHEAT_COUNT)
93
     LOOP_L_N(m, PREHEAT_COUNT)
266
              skip1 = !has2 && (LCD_HEIGHT) >= 5;
266
              skip1 = !has2 && (LCD_HEIGHT) >= 5;
267
 
267
 
268
   START_SCREEN();
268
   START_SCREEN();
269
-  STATIC_ITEM_P(pause_header(), SS_CENTER|SS_INVERT);           // 1: Header
269
+  STATIC_ITEM_P(pause_header(), SS_DEFAULT|SS_INVERT);          // 1: Header
270
   if (skip1) SKIP_ITEM();                                       // Move a single-line message down
270
   if (skip1) SKIP_ITEM();                                       // Move a single-line message down
271
   STATIC_ITEM_P(msg1);                                          // 2: Message Line 1
271
   STATIC_ITEM_P(msg1);                                          // 2: Message Line 1
272
   if (has2) STATIC_ITEM_P(msg2);                                // 3: Message Line 2
272
   if (has2) STATIC_ITEM_P(msg2);                                // 3: Message Line 2

+ 2
- 2
Marlin/src/lcd/menu/menu_info.cpp View File

205
   if (ui.use_click()) return ui.go_back();
205
   if (ui.use_click()) return ui.go_back();
206
 
206
 
207
   START_SCREEN();
207
   START_SCREEN();
208
-  STATIC_ITEM_P(PSTR(BOARD_INFO_NAME), SS_CENTER|SS_INVERT);       // MyPrinterController
208
+  STATIC_ITEM_P(PSTR(BOARD_INFO_NAME), SS_DEFAULT|SS_INVERT);      // MyPrinterController
209
   #ifdef BOARD_WEBSITE_URL
209
   #ifdef BOARD_WEBSITE_URL
210
     STATIC_ITEM_P(PSTR(BOARD_WEBSITE_URL), SS_LEFT);               // www.my3dprinter.com
210
     STATIC_ITEM_P(PSTR(BOARD_WEBSITE_URL), SS_LEFT);               // www.my3dprinter.com
211
   #endif
211
   #endif
237
   void menu_info_printer() {
237
   void menu_info_printer() {
238
     if (ui.use_click()) return ui.go_back();
238
     if (ui.use_click()) return ui.go_back();
239
     START_SCREEN();
239
     START_SCREEN();
240
-    STATIC_ITEM(MSG_MARLIN, SS_CENTER|SS_INVERT);               // Marlin
240
+    STATIC_ITEM(MSG_MARLIN, SS_DEFAULT|SS_INVERT);              // Marlin
241
     STATIC_ITEM_P(PSTR(SHORT_BUILD_VERSION));                   // x.x.x-Branch
241
     STATIC_ITEM_P(PSTR(SHORT_BUILD_VERSION));                   // x.x.x-Branch
242
     STATIC_ITEM_P(PSTR(STRING_DISTRIBUTION_DATE));              // YYYY-MM-DD HH:MM
242
     STATIC_ITEM_P(PSTR(STRING_DISTRIBUTION_DATE));              // YYYY-MM-DD HH:MM
243
     STATIC_ITEM_P(PSTR(MACHINE_NAME));                          // My3DPrinter
243
     STATIC_ITEM_P(PSTR(MACHINE_NAME));                          // My3DPrinter

+ 1
- 1
Marlin/src/lcd/menu/menu_led.cpp View File

37
     void menu_led_presets() {
37
     void menu_led_presets() {
38
       START_MENU();
38
       START_MENU();
39
       #if LCD_HEIGHT > 2
39
       #if LCD_HEIGHT > 2
40
-        STATIC_ITEM(MSG_LED_PRESETS, SS_CENTER|SS_INVERT);
40
+        STATIC_ITEM(MSG_LED_PRESETS, SS_DEFAULT|SS_INVERT);
41
       #endif
41
       #endif
42
       BACK_ITEM(MSG_LED_CONTROL);
42
       BACK_ITEM(MSG_LED_CONTROL);
43
       ACTION_ITEM(MSG_SET_LEDS_WHITE, leds.set_white);
43
       ACTION_ITEM(MSG_SET_LEDS_WHITE, leds.set_white);

+ 2
- 2
Marlin/src/lcd/menu/menu_mmu2.cpp View File

131
 void menu_mmu2_choose_filament() {
131
 void menu_mmu2_choose_filament() {
132
   START_MENU();
132
   START_MENU();
133
   #if LCD_HEIGHT > 2
133
   #if LCD_HEIGHT > 2
134
-    STATIC_ITEM(MSG_MMU2_CHOOSE_FILAMENT_HEADER, SS_CENTER|SS_INVERT);
134
+    STATIC_ITEM(MSG_MMU2_CHOOSE_FILAMENT_HEADER, SS_DEFAULT|SS_INVERT);
135
   #endif
135
   #endif
136
   LOOP_L_N(i, 5) ACTION_ITEM_N(i, MSG_MMU2_FILAMENT_N, []{ action_mmu2_choose(MenuItemBase::itemIndex); });
136
   LOOP_L_N(i, 5) ACTION_ITEM_N(i, MSG_MMU2_FILAMENT_N, []{ action_mmu2_choose(MenuItemBase::itemIndex); });
137
   END_MENU();
137
   END_MENU();
145
   currentTool = mmu2.get_current_tool();
145
   currentTool = mmu2.get_current_tool();
146
   START_MENU();
146
   START_MENU();
147
   #if LCD_HEIGHT > 2
147
   #if LCD_HEIGHT > 2
148
-    STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, SS_CENTER|SS_INVERT);
148
+    STATIC_ITEM(MSG_FILAMENT_CHANGE_HEADER, SS_DEFAULT|SS_INVERT);
149
   #endif
149
   #endif
150
   ACTION_ITEM(MSG_MMU2_RESUME, []{ mmuMenuWait = false; });
150
   ACTION_ITEM(MSG_MMU2_RESUME, []{ mmuMenuWait = false; });
151
   ACTION_ITEM(MSG_MMU2_UNLOAD_FILAMENT, []{ mmu2.unload(); });
151
   ACTION_ITEM(MSG_MMU2_UNLOAD_FILAMENT, []{ mmu2.unload(); });

+ 4
- 4
Marlin/src/lcd/menu/menu_motion.cpp View File

178
   START_MENU();
178
   START_MENU();
179
   if (LCD_HEIGHT >= 4) {
179
   if (LCD_HEIGHT >= 4) {
180
     switch (axis) {
180
     switch (axis) {
181
-      case X_AXIS: STATIC_ITEM(MSG_MOVE_X, SS_CENTER|SS_INVERT); break;
182
-      case Y_AXIS: STATIC_ITEM(MSG_MOVE_Y, SS_CENTER|SS_INVERT); break;
183
-      case Z_AXIS: STATIC_ITEM(MSG_MOVE_Z, SS_CENTER|SS_INVERT); break;
181
+      case X_AXIS: STATIC_ITEM(MSG_MOVE_X, SS_DEFAULT|SS_INVERT); break;
182
+      case Y_AXIS: STATIC_ITEM(MSG_MOVE_Y, SS_DEFAULT|SS_INVERT); break;
183
+      case Z_AXIS: STATIC_ITEM(MSG_MOVE_Z, SS_DEFAULT|SS_INVERT); break;
184
       default:
184
       default:
185
         TERN_(MANUAL_E_MOVES_RELATIVE, manual_move_e_origin = current_position.e);
185
         TERN_(MANUAL_E_MOVES_RELATIVE, manual_move_e_origin = current_position.e);
186
-        STATIC_ITEM(MSG_MOVE_E, SS_CENTER|SS_INVERT);
186
+        STATIC_ITEM(MSG_MOVE_E, SS_DEFAULT|SS_INVERT);
187
         break;
187
         break;
188
     }
188
     }
189
   }
189
   }

+ 3
- 3
Marlin/src/lcd/tft/ui_320x240.cpp View File

341
 }
341
 }
342
 
342
 
343
 // Draw a static item with no left-right margin required. Centered by default.
343
 // Draw a static item with no left-right margin required. Centered by default.
344
-void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_DEFAULT*/, const char * const valstr/*=nullptr*/) {
344
+void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) {
345
   menu_item(row);
345
   menu_item(row);
346
   tft_string.set(pstr, itemIndex, itemString);
346
   tft_string.set(pstr, itemIndex, itemString);
347
-  if (valstr)
348
-    tft_string.add(valstr);
347
+  if (vstr)
348
+    tft_string.add(vstr);
349
   tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, COLOR_YELLOW, tft_string);
349
   tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, COLOR_YELLOW, tft_string);
350
 }
350
 }
351
 
351
 

+ 3
- 3
Marlin/src/lcd/tft/ui_480x320.cpp View File

345
 }
345
 }
346
 
346
 
347
 // Draw a static item with no left-right margin required. Centered by default.
347
 // Draw a static item with no left-right margin required. Centered by default.
348
-void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_DEFAULT*/, const char * const valstr/*=nullptr*/) {
348
+void MenuItem_static::draw(const uint8_t row, PGM_P const pstr, const uint8_t style/*=SS_DEFAULT*/, const char * const vstr/*=nullptr*/) {
349
   menu_item(row);
349
   menu_item(row);
350
   tft_string.set(pstr, itemIndex, itemString);
350
   tft_string.set(pstr, itemIndex, itemString);
351
-  if (valstr)
352
-    tft_string.add(valstr);
351
+  if (vstr)
352
+    tft_string.add(vstr);
353
   tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, COLOR_YELLOW, tft_string);
353
   tft.add_text(tft_string.center(TFT_WIDTH), MENU_TEXT_Y_OFFSET, COLOR_YELLOW, tft_string);
354
 }
354
 }
355
 
355
 

Loading…
Cancel
Save