From e527cc499960f8481f67dec774cfdc8fa8d6f1c0 Mon Sep 17 00:00:00 2001 From: Roman Pytkov Date: Fri, 27 Feb 2026 02:44:26 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=BB=D1=83=D1=87=D1=88=D0=B5=D0=BD?= =?UTF-8?q?=D1=8B=20=D1=82=D0=B0=D0=B1=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui/left_panel.zig | 6 ++++-- src/ui/tab_bar.zig | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ui/left_panel.zig b/src/ui/left_panel.zig index f941b31..9e72314 100644 --- a/src/ui/left_panel.zig +++ b/src/ui/left_panel.zig @@ -51,7 +51,7 @@ fn objectTreeRow(open_doc: *WindowContext.OpenDocument, obj: *Object, depth: u32 .mouse => |*mouse| { if (!dvui.eventMatchSimple(e, row_data)) continue; hovered = true; - if (mouse.action == .press and mouse.button == .left) { + if (mouse.action == .release and mouse.button == .left) { select_row = true; } }, @@ -84,6 +84,7 @@ fn objectTreeRow(open_doc: *WindowContext.OpenDocument, obj: *Object, depth: u32 }; if (dvui.buttonIcon(@src(), "Delete object", icons.trash, .{}, .{}, delete_opts)) { object_callback.* = .{ .delete = obj.id }; + select_row = false; } } } @@ -122,7 +123,8 @@ fn objectTree(ctx: *WindowContext) void { }, .delete => |obj_id| { _ = doc.removeObjectById(obj_id); - open_doc.selected_object_id = null; + if (open_doc.selected_object_id == obj_id) + open_doc.selected_object_id = null; open_doc.canvas.requestRedraw(); }, } diff --git a/src/ui/tab_bar.zig b/src/ui/tab_bar.zig index 9d45bf4..2beba73 100644 --- a/src/ui/tab_bar.zig +++ b/src/ui/tab_bar.zig @@ -34,7 +34,7 @@ fn documentTab(ctx: *WindowContext, index: usize, callback: *?DocCallback) void .mouse => |*mouse| { if (!dvui.eventMatchSimple(e, row_data)) continue; hovered = true; - if (mouse.action == .press and mouse.button == .left) { + if (mouse.action == .release and mouse.button == .left) { select_row = true; } }, @@ -67,6 +67,7 @@ fn documentTab(ctx: *WindowContext, index: usize, callback: *?DocCallback) void .gravity_y = 0.5, })) { callback.* = .{ .close = index }; + select_row = false; } } }