From 6da477e6bf675c10e1eb5c3279a06dffeb0c3947 Mon Sep 17 00:00:00 2001 From: swissnorp <67485708+swissnorp@users.noreply.github.com> Date: Thu, 6 Aug 2020 05:38:23 +0200 Subject: [PATCH] Move Cancel Object menu, fix canceled item index (#18930) --- Marlin/src/lcd/menu/menu_advanced.cpp | 5 ----- Marlin/src/lcd/menu/menu_cancelobject.cpp | 2 +- Marlin/src/lcd/menu/menu_main.cpp | 6 ++++++ 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Marlin/src/lcd/menu/menu_advanced.cpp b/Marlin/src/lcd/menu/menu_advanced.cpp index 81baa6156..1c37b2f2d 100644 --- a/Marlin/src/lcd/menu/menu_advanced.cpp +++ b/Marlin/src/lcd/menu/menu_advanced.cpp @@ -53,7 +53,6 @@ void menu_tmc(); void menu_backlash(); -void menu_cancelobject(); #if ENABLED(DAC_STEPPER_CURRENT) @@ -560,10 +559,6 @@ void menu_advanced_settings() { SUBMENU(MSG_BACKLASH, menu_backlash); #endif - #if ENABLED(CANCEL_OBJECTS) - SUBMENU(MSG_CANCEL_OBJECT, []{ editable.int8 = -1; ui.goto_screen(menu_cancelobject); }); - #endif - #if ENABLED(DAC_STEPPER_CURRENT) SUBMENU(MSG_DRIVE_STRENGTH, menu_dac); #endif diff --git a/Marlin/src/lcd/menu/menu_cancelobject.cpp b/Marlin/src/lcd/menu/menu_cancelobject.cpp index 095e4eb7b..55b88c45b 100644 --- a/Marlin/src/lcd/menu/menu_cancelobject.cpp +++ b/Marlin/src/lcd/menu/menu_cancelobject.cpp @@ -43,7 +43,7 @@ static void lcd_cancel_object_confirm() { }; MenuItem_confirm::confirm_screen( []{ - cancelable.cancel_object(MenuItemBase::itemIndex - 1); + cancelable.cancel_object(MenuItemBase::itemIndex); ui.completion_feedback(); ui.goto_previous_screen(); }, diff --git a/Marlin/src/lcd/menu/menu_main.cpp b/Marlin/src/lcd/menu/menu_main.cpp index 51b67209d..059290c52 100644 --- a/Marlin/src/lcd/menu/menu_main.cpp +++ b/Marlin/src/lcd/menu/menu_main.cpp @@ -51,6 +51,7 @@ #endif void menu_tune(); +void menu_cancelobject(); void menu_motion(); void menu_temperature(); void menu_configuration(); @@ -110,7 +111,12 @@ void menu_main() { ); }); #endif + SUBMENU(MSG_TUNE, menu_tune); + + #if ENABLED(CANCEL_OBJECTS) && DISABLED(SLIM_LCD_MENUS) + SUBMENU(MSG_CANCEL_OBJECT, []{ editable.int8 = -1; ui.goto_screen(menu_cancelobject); }); + #endif } else {