mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-14 04:28:36 -07:00
File list offset fix
This commit is contained in:
@@ -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;
|
offset_new = model->item_idx - FILE_LIST_BUF_LEN / 4 * 1;
|
||||||
}
|
}
|
||||||
if(offset_new > 0) {
|
if(offset_new > 0) {
|
||||||
offset_new =
|
offset_new = CLAMP(offset_new, (int32_t)model->item_cnt, 0);
|
||||||
CLAMP(offset_new, (int32_t)model->item_cnt - FILE_LIST_BUF_LEN, 0);
|
|
||||||
} else {
|
} else {
|
||||||
offset_new = 0;
|
offset_new = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#define TAB_RIGHT InputKeyRight // Default tab swith direction
|
#define TAB_RIGHT InputKeyRight // Default tab swith direction
|
||||||
#define TAB_DEFAULT ArchiveTabFavorites // Start tab
|
#define TAB_DEFAULT ArchiveTabFavorites // Start tab
|
||||||
#define FILE_LIST_BUF_LEN 100
|
#define FILE_LIST_BUF_LEN 50
|
||||||
|
|
||||||
static const char* tab_default_paths[] = {
|
static const char* tab_default_paths[] = {
|
||||||
[ArchiveTabFavorites] = "/app:favorites",
|
[ArchiveTabFavorites] = "/app:favorites",
|
||||||
|
|||||||
@@ -527,7 +527,7 @@ static bool file_browser_view_input_callback(InputEvent* event, void* context) {
|
|||||||
model->list_loading = true;
|
model->list_loading = true;
|
||||||
int32_t load_offset = CLAMP(
|
int32_t load_offset = CLAMP(
|
||||||
model->item_idx - ITEM_LIST_LEN_MAX / 4 * 3,
|
model->item_idx - ITEM_LIST_LEN_MAX / 4 * 3,
|
||||||
(int32_t)model->item_cnt - ITEM_LIST_LEN_MAX,
|
(int32_t)model->item_cnt,
|
||||||
0);
|
0);
|
||||||
file_browser_worker_load(
|
file_browser_worker_load(
|
||||||
browser->worker, load_offset, ITEM_LIST_LEN_MAX);
|
browser->worker, load_offset, ITEM_LIST_LEN_MAX);
|
||||||
@@ -538,7 +538,7 @@ static bool file_browser_view_input_callback(InputEvent* event, void* context) {
|
|||||||
model->list_loading = true;
|
model->list_loading = true;
|
||||||
int32_t load_offset = CLAMP(
|
int32_t load_offset = CLAMP(
|
||||||
model->item_idx - ITEM_LIST_LEN_MAX / 4 * 1,
|
model->item_idx - ITEM_LIST_LEN_MAX / 4 * 1,
|
||||||
(int32_t)model->item_cnt - ITEM_LIST_LEN_MAX,
|
(int32_t)model->item_cnt,
|
||||||
0);
|
0);
|
||||||
file_browser_worker_load(
|
file_browser_worker_load(
|
||||||
browser->worker, load_offset, ITEM_LIST_LEN_MAX);
|
browser->worker, load_offset, ITEM_LIST_LEN_MAX);
|
||||||
|
|||||||
Reference in New Issue
Block a user