Skip to content

Commit

Permalink
✨ GENERIC_BACK_MENU_ITEM
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Aug 19, 2024
1 parent 2fd1c48 commit bebf5dc
Show file tree
Hide file tree
Showing 2 changed files with 10 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 @@ -1554,6 +1554,9 @@
// BACK menu items keep the highlight at the top
//#define TURBO_BACK_MENU_ITEM

// BACK menu items show "Back" instead of the previous menu name
//#define GENERIC_BACK_MENU_ITEM

// Insert a menu for preheating at the top level to allow for quick access
//#define PREHEAT_SHORTCUT_MENU_ITEM

Expand Down
11 changes: 7 additions & 4 deletions Marlin/src/lcd/menu/menu_item.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,12 +426,15 @@ class MenuItem_bool : public MenuEditItemBase {

// Predefined menu item types //

#if DISABLED(NO_BACK_MENU_ITEM)
#define BACK_ITEM_F(FLABEL) MENU_ITEM_F(back, FLABEL)
#define BACK_ITEM(LABEL) MENU_ITEM(back, LABEL)
#else
#if ENABLED(NO_BACK_MENU_ITEM)
#define BACK_ITEM_F(FLABEL) NOOP
#define BACK_ITEM(LABEL) NOOP
#elif ENABLED(GENERIC_BACK_MENU_ITEM)
#define BACK_ITEM_F(V...) MENU_ITEM_F(back, GET_TEXT_F(MSG_BACK))
#define BACK_ITEM(V...) MENU_ITEM(back, MSG_BACK)
#else
#define BACK_ITEM_F(FLABEL) MENU_ITEM_F(back, FLABEL)
#define BACK_ITEM(LABEL) MENU_ITEM(back, LABEL)
#endif

#define ACTION_ITEM_N_S_F(N, S, FLABEL, ACTION) MENU_ITEM_N_S_F(function, N, S, FLABEL, ACTION)
Expand Down

0 comments on commit bebf5dc

Please sign in to comment.