Selaa lähdekoodia

Clear menu history for browse media on insert (#20236)

Co-authored-by: Scott Lahteine <github@thinkyhead.com>
qwewer0 3 vuotta sitten
vanhempi
commit
e19c016c74
No account linked to committer's email address

+ 1
- 0
Marlin/src/lcd/marlinui.cpp Näytä tiedosto

@@ -1625,6 +1625,7 @@ void MarlinUI::update() {
1625 1625
       if (old_status < 2) {
1626 1626
         TERN_(EXTENSIBLE_UI, ExtUI::onMediaInserted()); // ExtUI response
1627 1627
         #if ENABLED(BROWSE_MEDIA_ON_INSERT)
1628
+          clear_menu_history();
1628 1629
           quick_feedback();
1629 1630
           goto_screen(MEDIA_MENU_GATEWAY);
1630 1631
         #else

+ 1
- 1
Marlin/src/lcd/menu/menu.cpp Näytä tiedosto

@@ -206,8 +206,8 @@ void MarlinUI::goto_screen(screenFunc_t screen, const uint16_t encoder/*=0*/, co
206 206
     screen_items = items;
207 207
     if (on_status_screen()) {
208 208
       defer_status_screen(false);
209
+      clear_menu_history();
209 210
       TERN_(AUTO_BED_LEVELING_UBL, ubl.lcd_map_control = false);
210
-      screen_history_depth = 0;
211 211
     }
212 212
 
213 213
     clear_lcd();

+ 3
- 0
Marlin/src/lcd/menu/menu.h Näytä tiedosto

@@ -249,3 +249,6 @@ void _lcd_draw_homing();
249 249
 #if ENABLED(TOUCH_SCREEN_CALIBRATION)
250 250
   void touch_screen_calibration();
251 251
 #endif
252
+
253
+extern uint8_t screen_history_depth;
254
+inline void clear_menu_history() { screen_history_depth = 0; }

+ 0
- 2
Marlin/src/lcd/menu/menu_media.cpp Näytä tiedosto

@@ -104,8 +104,6 @@ class MenuItem_sdfolder : public MenuItem_sdbase {
104 104
     }
105 105
 };
106 106
 
107
-extern uint8_t screen_history_depth;
108
-
109 107
 void menu_media() {
110 108
   ui.encoder_direction_menus();
111 109
 

Loading…
Peruuta
Tallenna