Kaynağa Gözat

🐛 Fix back button (#24694)

EvilGremlin 2 yıl önce
ebeveyn
işleme
b229fba98b
No account linked to committer's email address

+ 0
- 4
Marlin/src/inc/Conditionals_post.h Dosyayı Görüntüle

@@ -3769,10 +3769,6 @@
3769 3769
   #define HAS_ROTARY_ENCODER 1
3770 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 3772
 #if PIN_EXISTS(SAFE_POWER) && DISABLED(DISABLE_DRIVER_SAFE_POWER_PROTECT)
3777 3773
   #define HAS_DRIVER_SAFE_POWER_PROTECT 1
3778 3774
 #endif

+ 1
- 1
Marlin/src/lcd/menu/menu_item.h Dosyayı Görüntüle

@@ -402,7 +402,7 @@ class MenuItem_bool : public MenuEditItemBase {
402 402
 
403 403
 // Predefined menu item types //
404 404
 
405
-#if HAS_BACK_ITEM
405
+#if DISABLED(DISABLE_ENCODER)
406 406
   #define BACK_ITEM_F(FLABEL)                            MENU_ITEM_F(back, FLABEL)
407 407
   #define BACK_ITEM(LABEL)                                 MENU_ITEM(back, LABEL)
408 408
 #else

+ 18
- 11
Marlin/src/lcd/menu/menu_main.cpp Dosyayı Görüntüle

@@ -222,6 +222,16 @@ void menu_configuration();
222 222
 
223 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 235
 void menu_main() {
226 236
   const bool busy = printingIsActive()
227 237
     #if ENABLED(SDSUPPORT)
@@ -317,6 +327,10 @@ void menu_main() {
317 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 334
   #if HAS_CUTTER
321 335
     SUBMENU(MSG_CUTTER(MENU), STICKY_SCREEN(menu_spindle_laser));
322 336
   #endif
@@ -325,17 +339,6 @@ void menu_main() {
325 339
     SUBMENU(MSG_TEMPERATURE, menu_temperature);
326 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 342
   #if HAS_POWER_MONITOR
340 343
     SUBMENU(MSG_POWER_MONITOR, menu_power_monitor);
341 344
   #endif
@@ -458,6 +461,10 @@ void menu_main() {
458 461
     });
459 462
   #endif
460 463
 
464
+  #if ENABLED(ADVANCED_PAUSE_FEATURE) && DISABLED(DISABLE_ENCODER)
465
+    FILAMENT_CHANGE_ITEM();
466
+  #endif
467
+
461 468
   END_MENU();
462 469
 }
463 470
 

Loading…
İptal
Kaydet