From 85798edd6d460cde8bd60a82a0fc82c9c9b78e2a Mon Sep 17 00:00:00 2001 From: luboslenco Date: Wed, 20 Aug 2025 18:25:57 +0200 Subject: [PATCH] Android fixes --- base/sources/iron_ui.c | 16 ++++++++++++++-- base/sources/ts/box_projects.ts | 4 ++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/base/sources/iron_ui.c b/base/sources/iron_ui.c index 6ae56b6f..4b5e9c86 100644 --- a/base/sources/iron_ui.c +++ b/base/sources/iron_ui.c @@ -23,6 +23,8 @@ static ui_t *ui_copy_receiver = NULL; static int ui_copy_frame = 0; static bool ui_combo_first = true; static ui_handle_t *ui_combo_search_handle = NULL; +static int touch_hold_x = -1; +static int touch_hold_y = -1; bool ui_touch_scroll = false; // Pan with finger to scroll bool ui_touch_hold = false; // Touch and hold finger for right click bool ui_touch_tooltip = false; // Show extra tooltips above finger / on-screen keyboard @@ -548,10 +550,20 @@ void ui_end_input() { current->is_key_pressed = true; } } - if (ui_touch_hold && current->input_down && current->input_x == current->input_started_x && current->input_y == current->input_started_y && current->input_started_time > 0 && iron_time() - current->input_started_time > 0.7) { + if (touch_hold_x > -1) { + current->input_x = touch_hold_x; + current->input_y = touch_hold_y; + touch_hold_x = -1; + touch_hold_y = -1; + current->input_released_r = true; + } + if (ui_touch_hold && current->input_down && current->input_x == current->input_started_x && current->input_y == current->input_started_y && current->input_started_time > 0 && iron_time() - current->input_started_time > 0.5) { current->touch_hold_activated = true; current->input_released = true; - current->input_released_r = true; + touch_hold_x = current->input_x; + touch_hold_y = current->input_y; + current->input_x = -1; + current->input_y = -1; current->input_started_time = 0; } } diff --git a/base/sources/ts/box_projects.ts b/base/sources/ts/box_projects.ts index adeb00f5..de5caf36 100644 --- a/base/sources/ts/box_projects.ts +++ b/base/sources/ts/box_projects.ts @@ -52,14 +52,14 @@ function box_projects_tab() { // Pick unique name let i: i32 = 0; let j: i32 = 0; - let title: string = tr("untitled") + i; + let title: string = "" + tr("untitled") + i; while (j < config_raw.recent_projects.length) { let base: string = config_raw.recent_projects[j]; base = substring(base, string_last_index_of(base, path_sep) + 1, string_last_index_of(base, ".")); j++; if (title == base) { i++; - title = tr("untitled") + i; + title = "" + tr("untitled") + i; j = 0; } }