Skip to content

Commit 242064f

Browse files
swissnorpthinkyhead
authored andcommitted
Move Cancel Object menu, fix canceled item index (MarlinFirmware#18930)
1 parent ad2d1b6 commit 242064f

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

Marlin/src/lcd/menu/menu_advanced.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353

5454
void menu_tmc();
5555
void menu_backlash();
56-
void menu_cancelobject();
5756

5857
#if ENABLED(DAC_STEPPER_CURRENT)
5958

@@ -560,10 +559,6 @@ void menu_advanced_settings() {
560559
SUBMENU(MSG_BACKLASH, menu_backlash);
561560
#endif
562561

563-
#if ENABLED(CANCEL_OBJECTS)
564-
SUBMENU(MSG_CANCEL_OBJECT, []{ editable.int8 = -1; ui.goto_screen(menu_cancelobject); });
565-
#endif
566-
567562
#if ENABLED(DAC_STEPPER_CURRENT)
568563
SUBMENU(MSG_DRIVE_STRENGTH, menu_dac);
569564
#endif

Marlin/src/lcd/menu/menu_cancelobject.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static void lcd_cancel_object_confirm() {
4343
};
4444
MenuItem_confirm::confirm_screen(
4545
[]{
46-
cancelable.cancel_object(MenuItemBase::itemIndex - 1);
46+
cancelable.cancel_object(MenuItemBase::itemIndex);
4747
ui.completion_feedback();
4848
ui.goto_previous_screen();
4949
},

Marlin/src/lcd/menu/menu_main.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
#endif
5252

5353
void menu_tune();
54+
void menu_cancelobject();
5455
void menu_motion();
5556
void menu_temperature();
5657
void menu_configuration();
@@ -110,7 +111,12 @@ void menu_main() {
110111
);
111112
});
112113
#endif
114+
113115
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
114120
}
115121
else {
116122

0 commit comments

Comments
 (0)