From cea06bc0ce6aabcd09789aaa4b0fb630423d89d6 Mon Sep 17 00:00:00 2001 From: 5brian Date: Tue, 25 Feb 2025 00:28:35 -0500 Subject: [PATCH] git_panel: Apply tooltip to checkbox instead of container (#25533) Closes #ISSUE Small tweak: The tooltip was activating on the icon |Before|After| |---|---| |![image](https://github.com/user-attachments/assets/a1a5b4a7-f949-402e-a038-5f1b4445f068)|![image](https://github.com/user-attachments/assets/cb55f193-e665-4e88-b8d8-a437a7200eea)| Release Notes: - N/A --- crates/git_ui/src/git_panel.rs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs index 22222b197e..f8e96095d8 100644 --- a/crates/git_ui/src/git_panel.rs +++ b/crates/git_ui/src/git_panel.rs @@ -2493,16 +2493,18 @@ impl GitPanel { }) }); - let start_slot = h_flex() - .id(("start-slot", ix)) - .gap(DynamicSpacing::Base04.rems(cx)) - .child(checkbox) - .tooltip(|window, cx| Tooltip::for_action("Stage File", &ToggleStaged, window, cx)) - .child(git_status_icon(status, cx)) - .on_mouse_down(MouseButton::Left, |_, _, cx| { - // prevent the list item active state triggering when toggling checkbox - cx.stop_propagation(); - }); + let start_slot = + h_flex() + .id(("start-slot", ix)) + .gap(DynamicSpacing::Base04.rems(cx)) + .child(checkbox.tooltip(|window, cx| { + Tooltip::for_action("Stage File", &ToggleStaged, window, cx) + })) + .child(git_status_icon(status, cx)) + .on_mouse_down(MouseButton::Left, |_, _, cx| { + // prevent the list item active state triggering when toggling checkbox + cx.stop_propagation(); + }); div() .w_full()