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>) {
|
||||
|
|
|
@ -51,6 +51,7 @@ pub enum Icon {
|
|||
CopilotDisabled,
|
||||
Dash,
|
||||
Disconnected,
|
||||
Ellipsis,
|
||||
Envelope,
|
||||
ExternalLink,
|
||||
ExclamationTriangle,
|
||||
|
@ -133,6 +134,7 @@ impl Icon {
|
|||
Icon::CopilotDisabled => "icons/copilot_disabled.svg",
|
||||
Icon::Dash => "icons/dash.svg",
|
||||
Icon::Disconnected => "icons/disconnected.svg",
|
||||
Icon::Ellipsis => "icons/ellipsis.svg",
|
||||
Icon::Envelope => "icons/feedback.svg",
|
||||
Icon::ExclamationTriangle => "icons/warning.svg",
|
||||
Icon::ExternalLink => "icons/external_link.svg",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue