Skip to content

Commit bebf5dc

Browse files
committed
✨ GENERIC_BACK_MENU_ITEM
1 parent 2fd1c48 commit bebf5dc

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Marlin/Configuration_adv.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,6 +1554,9 @@
15541554
// BACK menu items keep the highlight at the top
15551555
//#define TURBO_BACK_MENU_ITEM
15561556

1557+
// BACK menu items show "Back" instead of the previous menu name
1558+
//#define GENERIC_BACK_MENU_ITEM
1559+
15571560
// Insert a menu for preheating at the top level to allow for quick access
15581561
//#define PREHEAT_SHORTCUT_MENU_ITEM
15591562

Marlin/src/lcd/menu/menu_item.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -426,12 +426,15 @@ class MenuItem_bool : public MenuEditItemBase {
426426

427427
// Predefined menu item types //
428428

429-
#if DISABLED(NO_BACK_MENU_ITEM)
430-
#define BACK_ITEM_F(FLABEL) MENU_ITEM_F(back, FLABEL)
431-
#define BACK_ITEM(LABEL) MENU_ITEM(back, LABEL)
432-
#else
429+
#if ENABLED(NO_BACK_MENU_ITEM)
433430
#define BACK_ITEM_F(FLABEL) NOOP
434431
#define BACK_ITEM(LABEL) NOOP
432+
#elif ENABLED(GENERIC_BACK_MENU_ITEM)
433+
#define BACK_ITEM_F(V...) MENU_ITEM_F(back, GET_TEXT_F(MSG_BACK))
434+
#define BACK_ITEM(V...) MENU_ITEM(back, MSG_BACK)
435+
#else
436+
#define BACK_ITEM_F(FLABEL) MENU_ITEM_F(back, FLABEL)
437+
#define BACK_ITEM(LABEL) MENU_ITEM(back, LABEL)
435438
#endif
436439

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

0 commit comments

Comments
 (0)