瀏覽代碼

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

Co-authored-by: Scott Lahteine <github@thinkyhead.com>
qwewer0 4 年之前
父節點
當前提交
e19c016c74
沒有連結到貢獻者的電子郵件帳戶。
共有 4 個檔案被更改,包括 5 行新增3 行删除
  1. 1
    0
      Marlin/src/lcd/marlinui.cpp
  2. 1
    1
      Marlin/src/lcd/menu/menu.cpp
  3. 3
    0
      Marlin/src/lcd/menu/menu.h
  4. 0
    2
      Marlin/src/lcd/menu/menu_media.cpp

+ 1
- 0
Marlin/src/lcd/marlinui.cpp 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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 查看文件

@@ -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…
取消
儲存