Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TURBO_BACK_MENU_ITEM option #14991

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
15 changes: 13 additions & 2 deletions Marlin/src/lcd/menu/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
8 changes: 7 additions & 1 deletion Marlin/src/lcd/menu/menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 6 additions & 1 deletion Marlin/src/lcd/ultralcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,12 @@ class MarlinUI {
static screenFunc_t currentScreen;
static void goto_screen(const screenFunc_t screen, const uint16_t encoder=0, const uint8_t top=0, const uint8_t items=0);
static void save_previous_screen();
static void goto_previous_screen();
static void goto_previous_screen(
#if ENABLED(TURBO_BACK_MENU_ITEM)
const bool is_back=false
#endif
);

static void return_to_status();
static inline bool on_status_screen() { return currentScreen == status_screen; }
static inline void run_current_screen() { (*currentScreen)(); }
Expand Down
3 changes: 3 additions & 0 deletions config/default/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/3DFabXYZ/Migbot/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/AlephObjects/TAZ4/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/Alfawise/U20/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/AliExpress/UM2pExt/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/Anet/A2/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/Anet/A2plus/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/Anet/A6/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/Anet/A8/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/Anet/A8plus/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/Anet/E16/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/AnyCubic/i3/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/ArmEd/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/BIBO/TouchX/cyclops/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/BIBO/TouchX/default/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/BQ/Hephestos/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/BQ/Hephestos_2/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/BQ/WITBOX/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/Cartesio/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/Creality/CR-10/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/Creality/CR-10S/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/Creality/CR-10_5S/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/Creality/CR-10mini/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/Creality/CR-20 Pro/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/Creality/CR-20/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/Creality/CR-8/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/Creality/Ender-2/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/Creality/Ender-3/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/Creality/Ender-4/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/Creality/Ender-5/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/Dagoma/Disco Ultimate/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
3 changes: 3 additions & 0 deletions config/examples/Einstart-S/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,9 @@
//#define LCD_PRINTER_INFO_IS_BOOTSCREEN // Show bootscreen(s) instead of Printer Info pages
#endif

// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

/**
* LED Control Menu
* Add LED Control to the LCD menu
Expand Down
Loading