Streamline menu item logic (#17664)
This commit is contained in:
@@ -45,25 +45,11 @@ void lcd_sd_updir() {
|
||||
|
||||
void MarlinUI::reselect_last_file() {
|
||||
if (sd_encoder_position == 0xFFFF) return;
|
||||
//#if HAS_GRAPHICAL_LCD
|
||||
// // This is a hack to force a screen update.
|
||||
// ui.refresh(LCDVIEW_CALL_REDRAW_NEXT);
|
||||
// ui.synchronize();
|
||||
// safe_delay(50);
|
||||
// ui.synchronize();
|
||||
// ui.refresh(LCDVIEW_CALL_REDRAW_NEXT);
|
||||
// ui.drawing_screen = ui.screen_changed = true;
|
||||
//#endif
|
||||
|
||||
goto_screen(menu_media, sd_encoder_position, sd_top_line, sd_items);
|
||||
sd_encoder_position = 0xFFFF;
|
||||
|
||||
defer_status_screen();
|
||||
|
||||
//#if HAS_GRAPHICAL_LCD
|
||||
// update();
|
||||
//#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
inline void sdcard_start_selected_file() {
|
||||
@@ -141,14 +127,13 @@ void menu_media() {
|
||||
if (ui.should_draw()) for (uint16_t i = 0; i < fileCnt; i++) {
|
||||
if (_menuLineNr == _thisItemNr) {
|
||||
card.getfilename_sorted(SD_ORDER(i, fileCnt));
|
||||
if (card.flag.filenameIsDir)
|
||||
MENU_ITEM_IF (card.flag.filenameIsDir)
|
||||
MENU_ITEM(sdfolder, MSG_MEDIA_MENU, card);
|
||||
else
|
||||
MENU_ITEM_ELSE
|
||||
MENU_ITEM(sdfile, MSG_MEDIA_MENU, card);
|
||||
}
|
||||
else {
|
||||
else
|
||||
SKIP_ITEM();
|
||||
}
|
||||
}
|
||||
END_MENU();
|
||||
}
|
||||
|
Reference in New Issue
Block a user