🐛 Fix TFT_COLOR_UI Release Media issue (#23123)

x301
Tanguy Pruvot 3 years ago committed by Scott Lahteine
parent 7a5f103bcf
commit 6264736968

@ -26,7 +26,6 @@
#include "../gcode.h" #include "../gcode.h"
#include "../../sd/cardreader.h" #include "../../sd/cardreader.h"
#include "../../lcd/marlinui.h"
/** /**
* M21: Init SD Card * M21: Init SD Card
@ -38,7 +37,6 @@ void GcodeSuite::M21() { card.mount(); }
*/ */
void GcodeSuite::M22() { void GcodeSuite::M22() {
if (!IS_SD_PRINTING()) card.release(); if (!IS_SD_PRINTING()) card.release();
IF_ENABLED(TFT_COLOR_UI, ui.refresh(LCDVIEW_CALL_REDRAW_NEXT));
} }
#endif // SDSUPPORT #endif // SDSUPPORT

@ -249,7 +249,14 @@ void menu_main() {
#if PIN_EXISTS(SD_DETECT) #if PIN_EXISTS(SD_DETECT)
GCODES_ITEM(MSG_CHANGE_MEDIA, PSTR("M21")); // M21 Change Media GCODES_ITEM(MSG_CHANGE_MEDIA, PSTR("M21")); // M21 Change Media
#else // - or - #else // - or -
GCODES_ITEM(MSG_RELEASE_MEDIA, PSTR("M22")); // M22 Release Media ACTION_ITEM(MSG_RELEASE_MEDIA, []{ // M22 Release Media
queue.inject(PSTR("M22"));
#if ENABLED(TFT_COLOR_UI)
// Menu display issue on item removal with multi language selection menu
if (encoderTopLine > 0) encoderTopLine--;
ui.refresh(LCDVIEW_CALL_REDRAW_NEXT);
#endif
});
#endif #endif
SUBMENU(MSG_MEDIA_MENU, MEDIA_MENU_GATEWAY); // Media Menu (or Password First) SUBMENU(MSG_MEDIA_MENU, MEDIA_MENU_GATEWAY); // Media Menu (or Password First)
} }

Loading…
Cancel
Save