From fb4e2e02be7a5418fb3f3aeaef8cf9acfe43860f Mon Sep 17 00:00:00 2001 From: Willy-JL Date: Sat, 11 Feb 2023 23:44:19 +0000 Subject: [PATCH] Hide files in browser while still loading --- applications/services/gui/modules/file_browser.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/applications/services/gui/modules/file_browser.c b/applications/services/gui/modules/file_browser.c index dba39bf24..dc3c65eed 100644 --- a/applications/services/gui/modules/file_browser.c +++ b/applications/services/gui/modules/file_browser.c @@ -515,19 +515,25 @@ static void browser_draw_list(Canvas* canvas, FileBrowserModel* model) { for(uint32_t i = 0; i < MIN(model->item_cnt, LIST_ITEMS); i++) { int32_t idx = CLAMP((uint32_t)(i + model->list_offset), model->item_cnt, 0u); - BrowserItemType item_type = BrowserItemTypeLoading; + BrowserItemType item_type; uint8_t* custom_icon_data = NULL; if(browser_is_item_in_array(model, idx)) { BrowserItem_t* item = items_array_get( model->items, CLAMP(idx - model->array_offset, (int32_t)(array_size - 1), 0)); item_type = item->type; - furi_string_set(filename, item->display_name); - if(item_type == BrowserItemTypeFile) { - custom_icon_data = item->custom_icon_data; + if(model->list_loading && item_type != BrowserItemTypeBack) { + furi_string_set(filename, "---"); + item_type = BrowserItemTypeLoading; + } else { + furi_string_set(filename, item->display_name); + if(item_type == BrowserItemTypeFile) { + custom_icon_data = item->custom_icon_data; + } } } else { furi_string_set(filename, "---"); + item_type = BrowserItemTypeLoading; } if(item_type == BrowserItemTypeBack) {