From bebf5dc6ab814692a94c68ebac0984b1b172972d Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 19 Aug 2024 14:37:39 -0500 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20GENERIC=5FBACK=5FMENU=5FITEM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/Configuration_adv.h | 3 +++ Marlin/src/lcd/menu/menu_item.h | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 3ffd1ee92aee..08db885be374 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -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 diff --git a/Marlin/src/lcd/menu/menu_item.h b/Marlin/src/lcd/menu/menu_item.h index 07aa59675a9f..bf7e20369515 100644 --- a/Marlin/src/lcd/menu/menu_item.h +++ b/Marlin/src/lcd/menu/menu_item.h @@ -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)