gpui: Simplify uniform list API by removing entity param (#32480)
This PR also introduces `Context::processor`, a sibling of `Context::listener` that takes a strong pointer to entity and allows for a return result. Release Notes: - N/A Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
parent
c55630889a
commit
f567bb52ff
17 changed files with 80 additions and 77 deletions
|
@ -4914,8 +4914,8 @@ impl Render for ProjectPanel {
|
|||
)
|
||||
.track_focus(&self.focus_handle(cx))
|
||||
.child(
|
||||
uniform_list(cx.entity().clone(), "entries", item_count, {
|
||||
|this, range, window, cx| {
|
||||
uniform_list("entries", item_count, {
|
||||
cx.processor(|this, range: Range<usize>, window, cx| {
|
||||
let mut items = Vec::with_capacity(range.end - range.start);
|
||||
this.for_each_visible_entry(
|
||||
range,
|
||||
|
@ -4926,7 +4926,7 @@ impl Render for ProjectPanel {
|
|||
},
|
||||
);
|
||||
items
|
||||
}
|
||||
})
|
||||
})
|
||||
.when(show_indent_guides, |list| {
|
||||
list.with_decoration(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue