Browse Source

Fix Select Screen cancel destination

vanilla_fb_2.0.x
Scott Lahteine 4 years ago
parent
commit
bf316d9ec5
  1. 5
      Marlin/src/lcd/menu/menu.cpp
  2. 1
      Marlin/src/lcd/menu/menu.h
  3. 2
      Marlin/src/lcd/menu/menu_advanced.cpp
  4. 8
      Marlin/src/lcd/menu/menu_configuration.cpp
  5. 2
      Marlin/src/lcd/menu/menu_mixer.cpp

5
Marlin/src/lcd/menu/menu.cpp

@ -412,7 +412,10 @@ void MenuItem_confirm::select_screen(
const bool ui_selection = ui.update_selection(), got_click = ui.use_click(); const bool ui_selection = ui.update_selection(), got_click = ui.use_click();
if (got_click || ui.should_draw()) { if (got_click || ui.should_draw()) {
draw_select_screen(yes, no, ui_selection, pref, string, suff); draw_select_screen(yes, no, ui_selection, pref, string, suff);
if (got_click) { ui_selection ? yesFunc() : noFunc(); } if (got_click) {
selectFunc_t callFunc = ui_selection ? yesFunc : noFunc;
if (callFunc) callFunc(); else ui.goto_previous_screen();
}
ui.defer_status_screen(); ui.defer_status_screen();
} }
} }

1
Marlin/src/lcd/menu/menu.h

@ -542,6 +542,7 @@ class MenuItem_bool : public MenuEditItemBase {
#define _CONFIRM_ITEM_INNER_P(PLABEL, V...) do { \ #define _CONFIRM_ITEM_INNER_P(PLABEL, V...) do { \
if (encoderLine == _thisItemNr && ui.use_click()) { \ if (encoderLine == _thisItemNr && ui.use_click()) { \
ui.save_previous_screen(); \
ui.goto_screen([]{MenuItem_confirm::select_screen(V);}); \ ui.goto_screen([]{MenuItem_confirm::select_screen(V);}); \
return; \ return; \
} \ } \

2
Marlin/src/lcd/menu/menu_advanced.cpp

@ -614,7 +614,7 @@ void menu_advanced_settings() {
#if ENABLED(EEPROM_SETTINGS) && DISABLED(SLIM_LCD_MENUS) #if ENABLED(EEPROM_SETTINGS) && DISABLED(SLIM_LCD_MENUS)
CONFIRM_ITEM(MSG_INIT_EEPROM, CONFIRM_ITEM(MSG_INIT_EEPROM,
MSG_BUTTON_INIT, MSG_BUTTON_CANCEL, MSG_BUTTON_INIT, MSG_BUTTON_CANCEL,
ui.init_eeprom, ui.goto_previous_screen, ui.init_eeprom, nullptr,
GET_TEXT(MSG_INIT_EEPROM), (const char *)nullptr, PSTR("?") GET_TEXT(MSG_INIT_EEPROM), (const char *)nullptr, PSTR("?")
); );
#endif #endif

8
Marlin/src/lcd/menu/menu_configuration.cpp

@ -224,11 +224,11 @@ void menu_advanced_settings();
ACTION_ITEM(MSG_BLTOUCH_STOW, bltouch._stow); ACTION_ITEM(MSG_BLTOUCH_STOW, bltouch._stow);
ACTION_ITEM(MSG_BLTOUCH_SW_MODE, bltouch._set_SW_mode); ACTION_ITEM(MSG_BLTOUCH_SW_MODE, bltouch._set_SW_mode);
#if ENABLED(BLTOUCH_LCD_VOLTAGE_MENU) #if ENABLED(BLTOUCH_LCD_VOLTAGE_MENU)
CONFIRM_ITEM(MSG_BLTOUCH_5V_MODE, MSG_BLTOUCH_5V_MODE, MSG_BUTTON_CANCEL, bltouch._set_5V_mode, ui.goto_previous_screen, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE)); CONFIRM_ITEM(MSG_BLTOUCH_5V_MODE, MSG_BLTOUCH_5V_MODE, MSG_BUTTON_CANCEL, bltouch._set_5V_mode, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE));
CONFIRM_ITEM(MSG_BLTOUCH_OD_MODE, MSG_BLTOUCH_OD_MODE, MSG_BUTTON_CANCEL, bltouch._set_OD_mode, ui.goto_previous_screen, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE)); CONFIRM_ITEM(MSG_BLTOUCH_OD_MODE, MSG_BLTOUCH_OD_MODE, MSG_BUTTON_CANCEL, bltouch._set_OD_mode, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE));
ACTION_ITEM(MSG_BLTOUCH_MODE_STORE, bltouch._mode_store); ACTION_ITEM(MSG_BLTOUCH_MODE_STORE, bltouch._mode_store);
CONFIRM_ITEM(MSG_BLTOUCH_MODE_STORE_5V, MSG_BLTOUCH_MODE_STORE_5V, MSG_BUTTON_CANCEL, bltouch.mode_conv_5V, ui.goto_previous_screen, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE)); CONFIRM_ITEM(MSG_BLTOUCH_MODE_STORE_5V, MSG_BLTOUCH_MODE_STORE_5V, MSG_BUTTON_CANCEL, bltouch.mode_conv_5V, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE));
CONFIRM_ITEM(MSG_BLTOUCH_MODE_STORE_OD, MSG_BLTOUCH_MODE_STORE_OD, MSG_BUTTON_CANCEL, bltouch.mode_conv_OD, ui.goto_previous_screen, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE)); CONFIRM_ITEM(MSG_BLTOUCH_MODE_STORE_OD, MSG_BLTOUCH_MODE_STORE_OD, MSG_BUTTON_CANCEL, bltouch.mode_conv_OD, nullptr, GET_TEXT(MSG_BLTOUCH_MODE_CHANGE));
ACTION_ITEM(MSG_BLTOUCH_MODE_ECHO, bltouch_report); ACTION_ITEM(MSG_BLTOUCH_MODE_ECHO, bltouch_report);
#endif #endif
END_MENU(); END_MENU();

2
Marlin/src/lcd/menu/menu_mixer.cpp

@ -264,7 +264,7 @@ void menu_mixer() {
LCD_MESSAGEPGM(MSG_VTOOLS_RESET); LCD_MESSAGEPGM(MSG_VTOOLS_RESET);
ui.return_to_status(); ui.return_to_status();
}, },
ui.goto_previous_screen, nullptr,
GET_TEXT(MSG_RESET_VTOOLS), (const char *)nullptr, PSTR("?") GET_TEXT(MSG_RESET_VTOOLS), (const char *)nullptr, PSTR("?")
); );

Loading…
Cancel
Save