Show context menu on project panel empty space right click
This commit is contained in:
parent
7235b3d29f
commit
35ce34c676
1 changed files with 10 additions and 0 deletions
|
@ -1515,6 +1515,16 @@ impl Render for ProjectPanel {
|
||||||
el.on_action(cx.listener(Self::reveal_in_finder))
|
el.on_action(cx.listener(Self::reveal_in_finder))
|
||||||
.on_action(cx.listener(Self::open_in_terminal))
|
.on_action(cx.listener(Self::open_in_terminal))
|
||||||
})
|
})
|
||||||
|
.on_mouse_down(
|
||||||
|
MouseButton::Right,
|
||||||
|
cx.listener(move |this, event: &MouseDownEvent, cx| {
|
||||||
|
// When deploying the context menu anywhere below the last project entry,
|
||||||
|
// act as if the user clicked the root of the last worktree.
|
||||||
|
if let Some(entry_id) = this.last_worktree_root_id {
|
||||||
|
this.deploy_context_menu(event.position, entry_id, cx);
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
)
|
||||||
.track_focus(&self.focus_handle)
|
.track_focus(&self.focus_handle)
|
||||||
.child(
|
.child(
|
||||||
uniform_list(
|
uniform_list(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue