Add TURBO_BACK_MENU_ITEM option (#14991)
This commit is contained in:
@ -88,10 +88,21 @@ void MarlinUI::save_previous_screen() {
|
||||
screen_history[screen_history_depth++] = { currentScreen, encoderPosition, encoderTopLine, screen_items };
|
||||
}
|
||||
|
||||
void MarlinUI::goto_previous_screen() {
|
||||
void MarlinUI::goto_previous_screen(
|
||||
#if ENABLED(TURBO_BACK_MENU_ITEM)
|
||||
const bool is_back/*=false*/
|
||||
#endif
|
||||
) {
|
||||
#if DISABLED(TURBO_BACK_MENU_ITEM)
|
||||
constexpr bool is_back = false;
|
||||
#endif
|
||||
if (screen_history_depth > 0) {
|
||||
menuPosition &sh = screen_history[--screen_history_depth];
|
||||
goto_screen(sh.menu_function, sh.encoder_position, sh.top_line, sh.items);
|
||||
goto_screen(sh.menu_function,
|
||||
is_back ? 0 : sh.encoder_position,
|
||||
is_back ? 0 : sh.top_line,
|
||||
sh.items
|
||||
);
|
||||
}
|
||||
else
|
||||
return_to_status();
|
||||
|
@ -144,7 +144,13 @@ DEFINE_DRAW_MENU_ITEM_SETTING_EDIT(long5_25); // 12345 right-justif
|
||||
|
||||
class MenuItem_back {
|
||||
public:
|
||||
static inline void action() { ui.goto_previous_screen(); }
|
||||
static inline void action() {
|
||||
ui.goto_previous_screen(
|
||||
#if ENABLED(TURBO_BACK_MENU_ITEM)
|
||||
true
|
||||
#endif
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
class MenuItem_submenu {
|
||||
|
Reference in New Issue
Block a user