Browse Source

🐛 Fix TFT_COLOR_UI Release Media issue (#23123)

Tanguy Pruvot 3 years ago
parent
commit
8277f3ca0d
No account linked to committer's email address
2 changed files with 8 additions and 3 deletions
  1. 0
    2
      Marlin/src/gcode/sd/M21_M22.cpp
  2. 8
    1
      Marlin/src/lcd/menu/menu_main.cpp

+ 0
- 2
Marlin/src/gcode/sd/M21_M22.cpp View File

@@ -26,7 +26,6 @@
26 26
 
27 27
 #include "../gcode.h"
28 28
 #include "../../sd/cardreader.h"
29
-#include "../../lcd/marlinui.h"
30 29
 
31 30
 /**
32 31
  * M21: Init SD Card
@@ -38,7 +37,6 @@ void GcodeSuite::M21() { card.mount(); }
38 37
  */
39 38
 void GcodeSuite::M22() {
40 39
   if (!IS_SD_PRINTING()) card.release();
41
-  IF_ENABLED(TFT_COLOR_UI, ui.refresh(LCDVIEW_CALL_REDRAW_NEXT));
42 40
 }
43 41
 
44 42
 #endif // SDSUPPORT

+ 8
- 1
Marlin/src/lcd/menu/menu_main.cpp View File

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

Loading…
Cancel
Save