Implement channel modal

Co-authored-by: Nathan <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld 2023-12-19 12:02:35 -08:00
parent 80b6922de7
commit 1c3698ae20
6 changed files with 213 additions and 243 deletions

View file

@ -72,11 +72,11 @@ impl ContextMenu {
pub fn entry(
mut self,
label: impl Into<SharedString>,
on_click: impl Fn(&mut WindowContext) + 'static,
handler: impl Fn(&mut WindowContext) + 'static,
) -> Self {
self.items.push(ContextMenuItem::Entry {
label: label.into(),
handler: Rc::new(on_click),
handler: Rc::new(handler),
icon: None,
action: None,
});
@ -114,6 +114,7 @@ impl ContextMenu {
pub fn cancel(&mut self, _: &menu::Cancel, cx: &mut ViewContext<Self>) {
cx.emit(DismissEvent);
cx.emit(DismissEvent);
}
fn select_first(&mut self, _: &SelectFirst, cx: &mut ViewContext<Self>) {