Optimize Media Menu display/scrolling (#15233)

This commit is contained in:
Robby Candra 2019-09-13 06:06:07 +07:00 committed by Scott Lahteine
parent f1162243f6
commit 1ab3521351

View File

@ -125,11 +125,19 @@ class MenuItem_sdfolder {
void menu_media() { void menu_media() {
ui.encoder_direction_menus(); ui.encoder_direction_menus();
const uint16_t fileCnt = card.get_num_Files(); #if HAS_GRAPHICAL_LCD
static uint16_t fileCnt;
if (ui.first_page) {
fileCnt = card.get_num_Files();
card.getWorkDirName();
}
#else
const uint16_t fileCnt = card.get_num_Files();
card.getWorkDirName();
#endif
START_MENU(); START_MENU();
MENU_BACK(MSG_MAIN); MENU_BACK(MSG_MAIN);
card.getWorkDirName();
if (card.filename[0] == '/') { if (card.filename[0] == '/') {
#if !PIN_EXISTS(SD_DETECT) #if !PIN_EXISTS(SD_DETECT)
MENU_ITEM(function, LCD_STR_REFRESH MSG_REFRESH, lcd_sd_refresh); MENU_ITEM(function, LCD_STR_REFRESH MSG_REFRESH, lcd_sd_refresh);