Checkpoint

This commit is contained in:
Mikayla 2023-11-06 15:11:22 -08:00
parent ea6755b1ca
commit 3c93b585ab
No known key found for this signature in database
7 changed files with 85 additions and 33 deletions

View file

@ -21,7 +21,8 @@
use std::ops::Range;
use gpui::{
div, list, AppContext, Component, Div, Element, ElementId, ParentElement, Render, ViewContext,
div, list, red, AppContext, Component, Div, Element, ElementId, ParentElement, Render, Styled,
ViewContext,
};
// pub struct Picker<D> {
@ -97,15 +98,18 @@ impl<V: PickerDelegate> Picker<V> {
impl<V: 'static + PickerDelegate> Picker<V> {
pub fn render(self, view: &mut V, cx: &mut ViewContext<V>) -> impl Component<V> {
div().id(self.id.clone()).child(list(
"candidates",
view.match_count(self.id.clone()),
move |this: &mut V, visible_range, cx| {
visible_range
.map(|ix| this.render_match(ix, false, false, false, self.id.clone(), cx))
.collect()
},
))
div().size_full().id(self.id.clone()).child(
list(
"candidates",
view.match_count(self.id.clone()),
move |this: &mut V, visible_range, cx| {
visible_range
.map(|ix| this.render_match(ix, false, false, false, self.id.clone(), cx))
.collect()
},
)
.size_full(),
)
}
}