From 55f06dcdb54914c2d8570d5a091cc846be597bce Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Mon, 26 Jun 2023 13:31:46 +0200 Subject: [PATCH] Add headers and footers to file finder --- crates/picker/src/picker.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/picker/src/picker.rs b/crates/picker/src/picker.rs index 69f16e4949..ee1eaf3bc9 100644 --- a/crates/picker/src/picker.rs +++ b/crates/picker/src/picker.rs @@ -45,6 +45,12 @@ pub trait PickerDelegate: Sized + 'static { fn center_selection_after_match_updates(&self) -> bool { false } + fn render_header(&self, cx: &AppContext) -> Option>> { + None + } + fn render_footer(&self, cx: &AppContext) -> Option>> { + None + } } impl Entity for Picker { @@ -77,6 +83,7 @@ impl View for Picker { .contained() .with_style(editor_style), ) + .with_children(self.delegate.render_header(cx)) .with_children(if match_count == 0 { if query.is_empty() { None @@ -118,6 +125,7 @@ impl View for Picker { .into_any(), ) }) + .with_children(self.delegate.render_footer(cx)) .contained() .with_style(container_style) .constrained()