Normalize picker padding (#54573)

Looks like this now:
<img width="608" height="152" alt="image"
src="https://github.com/user-attachments/assets/275c9574-e4fe-4855-b269-051b68b87bbe"
/>

Closes #53188

Release Notes:

- N/A or Added/Fixed/Improved ...
This commit is contained in:
Cameron Mcloughlin 2026-04-23 11:15:33 +01:00 committed by GitHub
parent 9c5d609543
commit 2ab32357a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)),
),
)
})
})