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.

Add back negative margins, now that they're supported again

Marshall Bowers19434afe0ace
diff --git a/crates/ui2/src/components/facepile.rs b/crates/ui2/src/components/facepile.rs
index a19d8d432d2..b7f1f78216e 100644
--- a/crates/ui2/src/components/facepile.rs
+++ b/crates/ui2/src/components/facepile.rs
@@ -24,8 +24,7 @@ impl<S: 'static + Send + Sync> Facepile<S> {
let isnt_last = ix < player_count - 1;
div()
- // TODO: Blocked on negative margins.
- // .when(isnt_last, |div| div.neg_mr_1())
+ .when(isnt_last, |div| div.neg_mr_1())
.child(Avatar::new(player.avatar_src().to_string()))
});
div().p_1().flex().items_center().children(player_list)
diff --git a/crates/ui2/src/components/list.rs b/crates/ui2/src/components/list.rs
index 476f7622aa4..b51e14a4e1d 100644
--- a/crates/ui2/src/components/list.rs
+++ b/crates/ui2/src/components/list.rs
@@ -377,12 +377,7 @@ impl<S: 'static + Send + Sync + Clone> ListEntry<S> {
match (self.toggle, self.disclosure_control_style) {
(Some(_), DisclosureControlVisibility::OnHover) => {
- Some(
- div()
- .absolute()
- // .neg_left_5()
- .child(disclosure_control_icon),
- )
+ Some(div().absolute().neg_left_5().child(disclosure_control_icon))
}
(Some(_), DisclosureControlVisibility::Always) => {
Some(div().child(disclosure_control_icon))
diff --git a/crates/ui2/src/components/player_stack.rs b/crates/ui2/src/components/player_stack.rs
index 415a2b911d3..e88470da385 100644
--- a/crates/ui2/src/components/player_stack.rs
+++ b/crates/ui2/src/components/player_stack.rs
@@ -62,10 +62,7 @@ impl<S: 'static + Send + Sync> PlayerStack<S> {
})
.child(Avatar::new(player.avatar_src().to_string()))
.children(followers.map(|followers| {
- div()
- // TODO: Blocked on negative margins.
- // .neg_ml_2()
- .child(Facepile::new(followers.into_iter()))
+ div().neg_ml_2().child(Facepile::new(followers.into_iter()))
})),
)
}