Render file finder separator in a way that doesn't affect layout
Previously, while typing, the separator appearing and disappeaering would cause the layout of the items below to jump up and down.
This commit is contained in:
parent
2cf692e8d5
commit
1b12437f7e
1 changed files with 7 additions and 2 deletions
|
@ -5,7 +5,7 @@ use gpui::{
|
|||
View, ViewContext, WindowContext,
|
||||
};
|
||||
use std::sync::Arc;
|
||||
use ui::{prelude::*, v_flex, Color, Divider, Label, ListItem, ListItemSpacing, ListSeparator};
|
||||
use ui::{prelude::*, v_flex, Color, Divider, Label, ListItem, ListItemSpacing};
|
||||
use workspace::ModalView;
|
||||
|
||||
pub struct Picker<D: PickerDelegate> {
|
||||
|
@ -296,7 +296,12 @@ impl<D: PickerDelegate> Render for Picker<D> {
|
|||
ix,
|
||||
ix == selected_index,
|
||||
cx,
|
||||
)).when(separators_after_indices.contains(&ix), |picker| picker.child(ListSeparator))
|
||||
)).when(separators_after_indices.contains(&ix), |picker| {
|
||||
picker
|
||||
.border_color(cx.theme().colors().border_variant)
|
||||
.border_b_1()
|
||||
.pb(px(-1.0))
|
||||
})
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue