Implement channel modal
Co-authored-by: Nathan <nathan@zed.dev>
This commit is contained in:
parent
80b6922de7
commit
1c3698ae20
6 changed files with 213 additions and 243 deletions
|
@ -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>) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue