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.

Normalize picker padding (#54573)

Cameron Mcloughlin2ab32357a56d
diff --git a/crates/picker/src/picker.rs b/crates/picker/src/picker.rs
index eba5b309619..cff9da17ac9 100644
--- a/crates/picker/src/picker.rs
+++ b/crates/picker/src/picker.rs
@@ -838,7 +838,7 @@ impl<D: PickerDelegate> Picker<D> {
el.with_width_from_item(Some(widest_item))
})
.flex_grow()
- .py_1()
+ .py(DynamicSpacing::Base04.rems(cx))
.track_scroll(&scroll_handle)
.into_any_element(),
ElementContainer::List(state) => list(
@@ -849,7 +849,7 @@ impl<D: PickerDelegate> Picker<D> {
)
.with_sizing_behavior(sizing_behavior)
.flex_grow()
- .py_2()
+ .py(DynamicSpacing::Base04.rems(cx))
.into_any_element(),
}
}
@@ -1123,13 +1123,16 @@ impl<D: PickerDelegate> Render for Picker<D> {
.when(self.delegate.match_count() == 0, |el| {
el.when_some(self.delegate.no_matches_text(window, cx), |el, text| {
el.child(
- v_flex().flex_grow().py_2().child(
- ListItem::new("empty_state")
- .inset(true)
- .spacing(ListItemSpacing::Sparse)
- .disabled(true)
- .child(Label::new(text).color(Color::Muted)),
- ),
+ v_flex()
+ .flex_grow()
+ .py(DynamicSpacing::Base04.rems(cx))
+ .child(
+ ListItem::new("empty_state")
+ .inset(true)
+ .spacing(ListItemSpacing::Sparse)
+ .disabled(true)
+ .child(Label::new(text).color(Color::Muted)),
+ ),
)
})
})