From 7e8a318b35a278d05ff7d067384775015d3be3ba Mon Sep 17 00:00:00 2001 From: Adanos020 Date: Wed, 3 Apr 2024 17:18:03 +0100 Subject: [PATCH] Fix dragging tabs --- src/widgets/dock_area/show/leaf.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/widgets/dock_area/show/leaf.rs b/src/widgets/dock_area/show/leaf.rs index 53e10fe..526f995 100644 --- a/src/widgets/dock_area/show/leaf.rs +++ b/src/widgets/dock_area/show/leaf.rs @@ -368,7 +368,14 @@ impl<'tree, Tab> DockArea<'tree, Tab> { } } - let response = tabs_ui.interact(response.rect.union(close_rect), id, sense); + let response = { + let rect = if close_rect == Rect::ZERO { + response.rect + } else { + response.rect.union(close_rect) + }; + tabs_ui.interact(rect, id, sense) + }; if let Some(pos) = state.last_hover_pos { // Use response.rect.contains instead of // response.hovered as the dragged tab covers