Render a context menu when right-clicking in project panel

It doesn't currently do anything, but I managed to get it rendering in an absolutely positioned way.
This commit is contained in:
Nathan Sobo 2022-05-24 18:30:04 -06:00 committed by Antonio Scandurra
parent f4d13ef596
commit b110fd5fb7
23 changed files with 260 additions and 91 deletions

View file

@ -168,7 +168,8 @@ impl View for LspStatus {
self.failed.join(", "),
if self.failed.len() > 1 { "s" } else { "" }
);
handler = Some(|_, cx: &mut EventContext| cx.dispatch_action(DismissErrorMessage));
handler =
Some(|_, _, cx: &mut EventContext| cx.dispatch_action(DismissErrorMessage));
} else {
return Empty::new().boxed();
}

View file

@ -788,7 +788,7 @@ impl Pane {
.with_cursor_style(CursorStyle::PointingHand)
.on_click({
let pane = pane.clone();
move |_, cx| {
move |_, _, cx| {
cx.dispatch_action(CloseItem {
item_id,
pane: pane.clone(),

View file

@ -293,7 +293,7 @@ impl View for SidebarButtons {
.boxed()
})
.with_cursor_style(CursorStyle::PointingHand)
.on_click(move |_, cx| {
.on_click(move |_, _, cx| {
cx.dispatch_action(ToggleSidebarItem {
side,
item_index: ix,

View file

@ -1730,7 +1730,7 @@ impl Workspace {
.with_style(style.container)
.boxed()
})
.on_click(|_, cx| cx.dispatch_action(Authenticate))
.on_click(|_, _, cx| cx.dispatch_action(Authenticate))
.with_cursor_style(CursorStyle::PointingHand)
.aligned()
.boxed(),
@ -1781,7 +1781,7 @@ impl Workspace {
if let Some(peer_id) = peer_id {
MouseEventHandler::new::<ToggleFollow, _, _>(replica_id.into(), cx, move |_, _| content)
.with_cursor_style(CursorStyle::PointingHand)
.on_click(move |_, cx| cx.dispatch_action(ToggleFollow(peer_id)))
.on_click(move |_, _, cx| cx.dispatch_action(ToggleFollow(peer_id)))
.boxed()
} else {
content