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
This commit is contained in:
5brian 2025-02-25 00:28:35 -05:00 committed by GitHub
parent 45146b6f30
commit cea06bc0ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2493,16 +2493,18 @@ impl GitPanel {
}) })
}); });
let start_slot = h_flex() let start_slot =
.id(("start-slot", ix)) h_flex()
.gap(DynamicSpacing::Base04.rems(cx)) .id(("start-slot", ix))
.child(checkbox) .gap(DynamicSpacing::Base04.rems(cx))
.tooltip(|window, cx| Tooltip::for_action("Stage File", &ToggleStaged, window, cx)) .child(checkbox.tooltip(|window, cx| {
.child(git_status_icon(status, cx)) Tooltip::for_action("Stage File", &ToggleStaged, window, cx)
.on_mouse_down(MouseButton::Left, |_, _, cx| { }))
// prevent the list item active state triggering when toggling checkbox .child(git_status_icon(status, cx))
cx.stop_propagation(); .on_mouse_down(MouseButton::Left, |_, _, cx| {
}); // prevent the list item active state triggering when toggling checkbox
cx.stop_propagation();
});
div() div()
.w_full() .w_full()