Skip to content

Commit

Permalink
Add TURBO_BACK_MENU_ITEM option (#14991)
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead authored Aug 21, 2019
1 parent 0cc524b commit 5e77760
Show file tree
Hide file tree
Showing 102 changed files with 323 additions and 4 deletions.
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 @@ -447,7 +447,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

0 comments on commit 5e77760

Please sign in to comment.