Quellcode durchsuchen

Move Cancel Object menu, fix canceled item index (#18930)

swissnorp vor 4 Jahren
Ursprung
Commit
6da477e6bf
Es ist kein Account mit der E-Mail-Adresse des Committers verbunden

+ 0
- 5
Marlin/src/lcd/menu/menu_advanced.cpp Datei anzeigen

@@ -53,7 +53,6 @@
53 53
 
54 54
 void menu_tmc();
55 55
 void menu_backlash();
56
-void menu_cancelobject();
57 56
 
58 57
 #if ENABLED(DAC_STEPPER_CURRENT)
59 58
 
@@ -560,10 +559,6 @@ void menu_advanced_settings() {
560 559
     SUBMENU(MSG_BACKLASH, menu_backlash);
561 560
   #endif
562 561
 
563
-  #if ENABLED(CANCEL_OBJECTS)
564
-    SUBMENU(MSG_CANCEL_OBJECT, []{ editable.int8 = -1; ui.goto_screen(menu_cancelobject); });
565
-  #endif
566
-
567 562
   #if ENABLED(DAC_STEPPER_CURRENT)
568 563
     SUBMENU(MSG_DRIVE_STRENGTH, menu_dac);
569 564
   #endif

+ 1
- 1
Marlin/src/lcd/menu/menu_cancelobject.cpp Datei anzeigen

@@ -43,7 +43,7 @@ static void lcd_cancel_object_confirm() {
43 43
   };
44 44
   MenuItem_confirm::confirm_screen(
45 45
     []{
46
-      cancelable.cancel_object(MenuItemBase::itemIndex - 1);
46
+      cancelable.cancel_object(MenuItemBase::itemIndex);
47 47
       ui.completion_feedback();
48 48
       ui.goto_previous_screen();
49 49
     },

+ 6
- 0
Marlin/src/lcd/menu/menu_main.cpp Datei anzeigen

@@ -51,6 +51,7 @@
51 51
 #endif
52 52
 
53 53
 void menu_tune();
54
+void menu_cancelobject();
54 55
 void menu_motion();
55 56
 void menu_temperature();
56 57
 void menu_configuration();
@@ -110,7 +111,12 @@ void menu_main() {
110 111
         );
111 112
       });
112 113
     #endif
114
+
113 115
     SUBMENU(MSG_TUNE, menu_tune);
116
+
117
+    #if ENABLED(CANCEL_OBJECTS) && DISABLED(SLIM_LCD_MENUS)
118
+      SUBMENU(MSG_CANCEL_OBJECT, []{ editable.int8 = -1; ui.goto_screen(menu_cancelobject); });
119
+    #endif
114 120
   }
115 121
   else {
116 122
 

Laden…
Abbrechen
Speichern