[FL-2977] Gui: better navigation in file browser dialog (#2014)

* Gui: proper navigation in file browser dialog
* Trim file name from start path
* File list loading fix
* File list offset fix

Co-authored-by: nminaylov <nm29719@gmail.com>
Co-authored-by: Sergey Gavrilov <who.just.the.doctor@gmail.com>
This commit is contained in:
あく
2022-11-29 03:59:24 +09:00
committed by GitHub
parent 6b47bc1af4
commit 769c53b6da
6 changed files with 41 additions and 6 deletions

View File

@@ -265,8 +265,7 @@ void archive_file_array_load(ArchiveBrowserView* browser, int8_t dir) {
offset_new = model->item_idx - FILE_LIST_BUF_LEN / 4 * 1;
}
if(offset_new > 0) {
offset_new =
CLAMP(offset_new, (int32_t)model->item_cnt - FILE_LIST_BUF_LEN, 0);
offset_new = CLAMP(offset_new, (int32_t)model->item_cnt, 0);
} else {
offset_new = 0;
}

View File

@@ -5,7 +5,7 @@
#define TAB_RIGHT InputKeyRight // Default tab switch direction
#define TAB_DEFAULT ArchiveTabFavorites // Start tab
#define FILE_LIST_BUF_LEN 100
#define FILE_LIST_BUF_LEN 50
static const char* tab_default_paths[] = {
[ArchiveTabFavorites] = "/app:favorites",