@@ -275,6 +275,15 @@ impl<D: PickerDelegate> Picker<D> {
Self::new(delegate, ContainerKind::UniformList, head, window, cx)
}
+ /// A picker, which displays its matches using `gpui::list`, matches can have different heights.
+ /// The picker allows the user to perform search items by text.
+ /// If `PickerDelegate::render_match` only returns items with the same height, use `Picker::uniform_list` as its implementation is optimized for that.
+ pub fn nonsearchable_list(delegate: D, window: &mut Window, cx: &mut Context<Self>) -> Self {
+ let head = Head::empty(Self::on_empty_head_blur, window, cx);
+
+ Self::new(delegate, ContainerKind::List, head, window, cx)
+ }
+
/// A picker, which displays its matches using `gpui::list`, matches can have different heights.
/// The picker allows the user to perform search items by text.
/// If `PickerDelegate::render_match` only returns items with the same height, use `Picker::uniform_list` as its implementation is optimized for that.
@@ -155,9 +155,9 @@ impl TabSwitcher {
Self {
picker: cx.new(|cx| {
if is_global {
- Picker::uniform_list(delegate, window, cx)
+ Picker::list(delegate, window, cx)
} else {
- Picker::nonsearchable_uniform_list(delegate, window, cx)
+ Picker::nonsearchable_list(delegate, window, cx)
}
}),
init_modifiers,