Windows fixes

This commit is contained in:
luboslenco
2024-09-24 18:26:51 +02:00
parent 817cb7d454
commit 9a4c579f88
2 changed files with 16 additions and 2 deletions
+12 -2
View File
@@ -26,6 +26,9 @@ function tab_browser_draw(htab: ui_handle_t) {
if (tab_browser_hpath.text == "" && config_raw.bookmarks.length > 0) { // Init to first bookmark
tab_browser_hpath.text = config_raw.bookmarks[0];
///if arm_windows
tab_browser_hpath.text = string_replace_all(tab_browser_hpath.text, "/", "\\");
///end
}
ui_begin_sticky();
@@ -40,7 +43,11 @@ function tab_browser_draw(htab: ui_handle_t) {
}
if (ui_button("+")) {
array_push(config_raw.bookmarks, tab_browser_hpath.text);
let bookmark: string = tab_browser_hpath.text;
///if arm_windows
bookmark = string_replace_all(bookmark, "\\", "/");
///end
array_push(config_raw.bookmarks, bookmark);
config_save();
}
if (ui.is_hovered) {
@@ -229,10 +236,13 @@ function tab_browser_draw(htab: ui_handle_t) {
for (let i: i32 = 0; i < config_raw.bookmarks.length; ++i) {
let b: string = config_raw.bookmarks[i];
let folder: string = substring(b, string_last_index_of(b, path_sep) + 1, b.length);
let folder: string = substring(b, string_last_index_of(b, "/") + 1, b.length);
if (ui_button(folder, ui_align_t.LEFT)) {
tab_browser_hpath.text = b;
///if arm_windows
tab_browser_hpath.text = string_replace_all(tab_browser_hpath.text, "/", "\\");
///end
}
if (ui.is_hovered && ui.input_released_r) {
+4
View File
@@ -76,6 +76,10 @@ function tab_textures_draw(htab: ui_handle_t) {
let asset: asset_t = project_assets[i];
let img: image_t = project_get_image(asset);
if (img == null) {
let empty_rt: render_target_t = map_get(render_path_render_targets, "empty_black");
img = empty_rt._image;
}
let uix: f32 = ui._x;
let uiy: f32 = ui._y;
let sw: i32 = img.height < img.width ? img.height : 0;