Browse Source

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

swissnorp 4 years ago
parent
commit
6da477e6bf
No account linked to committer's email address

+ 0
- 5
Marlin/src/lcd/menu/menu_advanced.cpp View File

@@ -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 View File

@@ -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 View File

@@ -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
 

Loading…
Cancel
Save