Browse Source

🐛 Fix back button (#24694)

EvilGremlin 2 years ago
parent
commit
b229fba98b
No account linked to committer's email address

+ 0
- 4
Marlin/src/inc/Conditionals_post.h View File

3769
   #define HAS_ROTARY_ENCODER 1
3769
   #define HAS_ROTARY_ENCODER 1
3770
 #endif
3770
 #endif
3771
 
3771
 
3772
-#if DISABLED(DISABLE_ENCODER) && ANY(HAS_ROTARY_ENCODER, HAS_ADC_BUTTONS) && ANY(TFT_CLASSIC_UI, TFT_COLOR_UI)
3773
-  #define HAS_BACK_ITEM 1
3774
-#endif
3775
-
3776
 #if PIN_EXISTS(SAFE_POWER) && DISABLED(DISABLE_DRIVER_SAFE_POWER_PROTECT)
3772
 #if PIN_EXISTS(SAFE_POWER) && DISABLED(DISABLE_DRIVER_SAFE_POWER_PROTECT)
3777
   #define HAS_DRIVER_SAFE_POWER_PROTECT 1
3773
   #define HAS_DRIVER_SAFE_POWER_PROTECT 1
3778
 #endif
3774
 #endif

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

402
 
402
 
403
 // Predefined menu item types //
403
 // Predefined menu item types //
404
 
404
 
405
-#if HAS_BACK_ITEM
405
+#if DISABLED(DISABLE_ENCODER)
406
   #define BACK_ITEM_F(FLABEL)                            MENU_ITEM_F(back, FLABEL)
406
   #define BACK_ITEM_F(FLABEL)                            MENU_ITEM_F(back, FLABEL)
407
   #define BACK_ITEM(LABEL)                                 MENU_ITEM(back, LABEL)
407
   #define BACK_ITEM(LABEL)                                 MENU_ITEM(back, LABEL)
408
 #else
408
 #else

+ 18
- 11
Marlin/src/lcd/menu/menu_main.cpp View File

222
 
222
 
223
 #endif // CUSTOM_MENU_MAIN
223
 #endif // CUSTOM_MENU_MAIN
224
 
224
 
225
+#if ENABLED(ADVANCED_PAUSE_FEATURE)
226
+  // This menu item is last with an encoder. Otherwise, somewhere in the middle.
227
+  #if E_STEPPERS == 1 && DISABLED(FILAMENT_LOAD_UNLOAD_GCODES)
228
+    #define FILAMENT_CHANGE_ITEM() YESNO_ITEM(MSG_FILAMENTCHANGE, menu_change_filament, nullptr, \
229
+                                    GET_TEXT_F(MSG_FILAMENTCHANGE), (const char *)nullptr, F("?"))
230
+  #else
231
+    #define FILAMENT_CHANGE_ITEM() SUBMENU(MSG_FILAMENTCHANGE, menu_change_filament)
232
+  #endif
233
+#endif
234
+
225
 void menu_main() {
235
 void menu_main() {
226
   const bool busy = printingIsActive()
236
   const bool busy = printingIsActive()
227
     #if ENABLED(SDSUPPORT)
237
     #if ENABLED(SDSUPPORT)
317
     SUBMENU(MSG_MOTION, menu_motion);
327
     SUBMENU(MSG_MOTION, menu_motion);
318
   }
328
   }
319
 
329
 
330
+  #if BOTH(ADVANCED_PAUSE_FEATURE, DISABLE_ENCODER)
331
+    FILAMENT_CHANGE_ITEM();
332
+  #endif
333
+
320
   #if HAS_CUTTER
334
   #if HAS_CUTTER
321
     SUBMENU(MSG_CUTTER(MENU), STICKY_SCREEN(menu_spindle_laser));
335
     SUBMENU(MSG_CUTTER(MENU), STICKY_SCREEN(menu_spindle_laser));
322
   #endif
336
   #endif
325
     SUBMENU(MSG_TEMPERATURE, menu_temperature);
339
     SUBMENU(MSG_TEMPERATURE, menu_temperature);
326
   #endif
340
   #endif
327
 
341
 
328
-  #if ENABLED(ADVANCED_PAUSE_FEATURE)
329
-    #if E_STEPPERS == 1 && DISABLED(FILAMENT_LOAD_UNLOAD_GCODES)
330
-      YESNO_ITEM(MSG_FILAMENTCHANGE,
331
-        menu_change_filament, nullptr,
332
-        GET_TEXT_F(MSG_FILAMENTCHANGE), (const char *)nullptr, F("?")
333
-      );
334
-    #else
335
-      SUBMENU(MSG_FILAMENTCHANGE, menu_change_filament);
336
-    #endif
337
-  #endif
338
-
339
   #if HAS_POWER_MONITOR
342
   #if HAS_POWER_MONITOR
340
     SUBMENU(MSG_POWER_MONITOR, menu_power_monitor);
343
     SUBMENU(MSG_POWER_MONITOR, menu_power_monitor);
341
   #endif
344
   #endif
458
     });
461
     });
459
   #endif
462
   #endif
460
 
463
 
464
+  #if ENABLED(ADVANCED_PAUSE_FEATURE) && DISABLED(DISABLE_ENCODER)
465
+    FILAMENT_CHANGE_ITEM();
466
+  #endif
467
+
461
   END_MENU();
468
   END_MENU();
462
 }
469
 }
463
 
470
 

Loading…
Cancel
Save