Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

git: Only show header staging checkboxes when hovering the header itself (#54204)

Cole Miller7fd07dda55ee
diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs
index 13e2d0970f1..1f9f08f47f0 100644
--- a/crates/git_ui/src/git_panel.rs
+++ b/crates/git_ui/src/git_panel.rs
@@ -4961,6 +4961,7 @@ impl GitPanel {
) -> AnyElement {
let id: ElementId = ElementId::Name(format!("header_{}", ix).into());
let checkbox_id: ElementId = ElementId::Name(format!("header_{}_checkbox", ix).into());
+ let group_name: SharedString = format!("header_{}", ix).into();
let toggle_state = self.header_state(header.header);
let section = header.header;
let weak = cx.weak_entity();
@@ -4968,6 +4969,7 @@ impl GitPanel {
h_flex()
.id(id)
+ .group(group_name.clone())
.h(self.list_item_height())
.w_full()
.items_center()
@@ -5011,7 +5013,7 @@ impl GitPanel {
}),
)
.when(!show_checkbox_persistently, |this| {
- this.visible_on_hover("entries")
+ this.visible_on_hover(group_name)
}),
)
.into_any_element()