From f0a86a2166b336954b116987446e860e5534d15a Mon Sep 17 00:00:00 2001 From: luboslenco Date: Fri, 26 Sep 2025 17:42:01 +0200 Subject: [PATCH] Tweak double click time --- paint/sources/tab_brushes.ts | 2 +- paint/sources/tab_fonts.ts | 2 +- paint/sources/tab_layers.ts | 2 +- paint/sources/tab_materials.ts | 2 +- paint/sources/tab_swatches.ts | 2 +- paint/sources/tab_textures.ts | 2 +- paint/sources/ui_files.ts | 2 +- paint/sources/ui_nodes.ts | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/paint/sources/tab_brushes.ts b/paint/sources/tab_brushes.ts index bf464c2f..6fc78c27 100644 --- a/paint/sources/tab_brushes.ts +++ b/paint/sources/tab_brushes.ts @@ -75,7 +75,7 @@ function tab_brushes_draw(htab: ui_handle_t) { if (context_raw.brush != project_brushes[i]) { context_select_brush(i); } - if (sys_time() - context_raw.select_time < 0.25) { + if (sys_time() - context_raw.select_time < 0.2) { ui_base_show_brush_nodes(); } context_raw.select_time = sys_time(); diff --git a/paint/sources/tab_fonts.ts b/paint/sources/tab_fonts.ts index 66250e5f..29a86872 100644 --- a/paint/sources/tab_fonts.ts +++ b/paint/sources/tab_fonts.ts @@ -97,7 +97,7 @@ function tab_fonts_draw(htab: ui_handle_t) { context_select_font(i); }); } - if (sys_time() - context_raw.select_time < 0.25) { + if (sys_time() - context_raw.select_time < 0.2) { ui_base_show_2d_view(view_2d_type_t.FONT); } context_raw.select_time = sys_time(); diff --git a/paint/sources/tab_layers.ts b/paint/sources/tab_layers.ts index 06799e10..9da780b8 100644 --- a/paint/sources/tab_layers.ts +++ b/paint/sources/tab_layers.ts @@ -409,7 +409,7 @@ function tab_layers_draw_layer_slot_full(l: slot_layer_t, i: i32) { let state: ui_state_t = ui_text(l.name); if (state == ui_state_t.RELEASED) { - if (sys_time() - context_raw.select_time < 0.25) { + if (sys_time() - context_raw.select_time < 0.2) { tab_layers_layer_name_edit = l.id; tab_layers_layer_name_handle.text = l.name; ui_start_text_edit(tab_layers_layer_name_handle); diff --git a/paint/sources/tab_materials.ts b/paint/sources/tab_materials.ts index ce69dbe5..e8d4d63c 100644 --- a/paint/sources/tab_materials.ts +++ b/paint/sources/tab_materials.ts @@ -132,7 +132,7 @@ function tab_materials_draw_slots(mini: bool) { base_drag_off_y = -(mouse_y - uiy - ui._window_y + 1); base_drag_material = context_raw.material; // Double click to show nodes - if (sys_time() - context_raw.select_time < 0.25) { + if (sys_time() - context_raw.select_time < 0.2) { ui_base_show_material_nodes(); base_drag_material = null; base_is_dragging = false; diff --git a/paint/sources/tab_swatches.ts b/paint/sources/tab_swatches.ts index ee0e7823..20dc1a78 100644 --- a/paint/sources/tab_swatches.ts +++ b/paint/sources/tab_swatches.ts @@ -135,7 +135,7 @@ function tab_swatches_draw(htab: ui_handle_t) { drag_pos_set = true; } else if (state == ui_state_t.RELEASED) { - if (sys_time() - context_raw.select_time < 0.25) { + if (sys_time() - context_raw.select_time < 0.2) { _tab_swatches_draw_i = i; diff --git a/paint/sources/tab_textures.ts b/paint/sources/tab_textures.ts index f3b0e2bf..8d37c621 100644 --- a/paint/sources/tab_textures.ts +++ b/paint/sources/tab_textures.ts @@ -86,7 +86,7 @@ function tab_textures_draw(htab: ui_handle_t) { base_drag_asset = asset; context_raw.texture = asset; - if (sys_time() - context_raw.select_time < 0.25) { + if (sys_time() - context_raw.select_time < 0.2) { ui_base_show_2d_view(view_2d_type_t.ASSET); } context_raw.select_time = sys_time(); diff --git a/paint/sources/ui_files.ts b/paint/sources/ui_files.ts index 4a59021b..a236601d 100644 --- a/paint/sources/ui_files.ts +++ b/paint/sources/ui_files.ts @@ -356,7 +356,7 @@ function ui_files_file_browser(handle: ui_handle_t, drag_files: bool = false, se } ui_files_selected = i; - if (sys_time() - context_raw.select_time < 0.25) { + if (sys_time() - context_raw.select_time < 0.2) { base_drag_file = null; base_drag_file_icon = null; base_is_dragging = false; diff --git a/paint/sources/ui_nodes.ts b/paint/sources/ui_nodes.ts index 17ba2a17..d4a20f7f 100644 --- a/paint/sources/ui_nodes.ts +++ b/paint/sources/ui_nodes.ts @@ -363,7 +363,7 @@ function ui_viewnodes_on_canvas_released() { if (ui_input_in_rect(ui._window_x + UI_NODE_X(node), ui._window_y + UI_NODE_Y(node), UI_NODE_W(node), UI_NODE_H(canvas, node))) { if (nodes.nodes_selected_id.length > 0 && node.id == nodes.nodes_selected_id[0]) { ui_view2d_hwnd.redraws = 2; - if (sys_time() - context_raw.select_time < 0.25) ui_base_show_2d_view(view_2d_type_t.NODE); + if (sys_time() - context_raw.select_time < 0.2) ui_base_show_2d_view(view_2d_type_t.NODE); context_raw.select_time = sys_time(); } break;