Skip to content

Commit

Permalink
Move Cancel Object menu, fix canceled item index (MarlinFirmware#18930)
Browse files Browse the repository at this point in the history
  • Loading branch information
swissnorp authored and thinkyhead committed Aug 7, 2020
1 parent ad2d1b6 commit 242064f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 0 additions & 5 deletions Marlin/src/lcd/menu/menu_advanced.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@

void menu_tmc();
void menu_backlash();
void menu_cancelobject();

#if ENABLED(DAC_STEPPER_CURRENT)

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/menu/menu_cancelobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
},
Expand Down
6 changes: 6 additions & 0 deletions Marlin/src/lcd/menu/menu_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#endif

void menu_tune();
void menu_cancelobject();
void menu_motion();
void menu_temperature();
void menu_configuration();
Expand Down Expand Up @@ -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 {

Expand Down

0 comments on commit 242064f

Please sign in to comment.