Browser fixes

This commit is contained in:
luboslenco
2025-09-13 13:55:49 +02:00
parent 034c6389f6
commit 83ad7b9d18
3 changed files with 7 additions and 3 deletions
+1
View File
@@ -221,6 +221,7 @@ function file_init_cloud_bytes(done: ()=>void, append: string = "") {
pos_start += 23;
let pos_end: i32 = string_index_of_pos(str, "</NextContinuationToken>", pos_start);
file_init_cloud_bytes(_file_init_cloud_bytes_done, "&start-after=" + substring(str, pos_start, pos_end));
_file_init_cloud_bytes_done();
}
else {
_file_init_cloud_bytes_done();
+5 -3
View File
@@ -5,6 +5,7 @@ let tab_browser_known: bool = false;
let tab_browser_last_path: string = "";
let _tab_browser_draw_file: string;
let _tab_browser_draw_b: string;
let tab_browser_refresh: bool = false;
function tab_browser_show_directory(directory: string) {
tab_browser_hpath.text = directory;
@@ -54,11 +55,10 @@ function tab_browser_draw(htab: ui_handle_t) {
}
// Refresh
let refresh: bool = false;
let in_focus: bool = ui.input_x > ui._window_x && ui.input_x < ui._window_x + ui._window_w &&
ui.input_y > ui._window_y && ui.input_y < ui._window_y + ui._window_h;
if (ui_button(tr("Refresh")) || (in_focus && ui.is_key_pressed && ui.key_code == key_code_t.F5)) {
refresh = true;
tab_browser_refresh = true;
}
// Previous folder
@@ -117,7 +117,7 @@ function tab_browser_draw(htab: ui_handle_t) {
ui._x = bookmarks_w;
ui._w -= bookmarks_w;
ui_files_file_browser(tab_browser_hpath, true, tab_browser_hsearch.text, refresh, function (file: string) {
ui_files_file_browser(tab_browser_hpath, true, tab_browser_hsearch.text, tab_browser_refresh, function (file: string) {
let file_name: string = substring(file, string_last_index_of(file, path_sep) + 1, file.length);
_tab_browser_draw_file = file;
@@ -200,6 +200,8 @@ function tab_browser_draw(htab: ui_handle_t) {
});
});
tab_browser_refresh = false;
if (tab_browser_known) {
let path: string = tab_browser_hpath.text;
sys_notify_on_next_frame(function (path: string) {
+1
View File
@@ -86,6 +86,7 @@ function ui_files_file_browser(handle: ui_handle_t, drag_files: bool = false, se
if (is_cloud && file_cloud == null) {
file_init_cloud(function () {
ui_base_hwnds[tab_area_t.STATUS].redraws = 3;
tab_browser_refresh = true;
});
}
if (is_cloud && file_read_directory("cloud").length == 0) {