Tidy up some broken menu items (#18306)

Release Notes:

- ssh-remoting: Don't show "reveal in finder" in menu
This commit is contained in:
Conrad Irwin 2024-09-24 15:37:09 -06:00 committed by GitHub
parent 2d71c36ad3
commit 5045f984a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 5 deletions

View file

@ -484,6 +484,7 @@ impl ProjectPanel {
let worktree_id = worktree.id();
let is_read_only = project.is_read_only();
let is_remote = project.is_via_collab() && project.dev_server_project_id().is_none();
let is_local = project.is_local();
let context_menu = ContextMenu::build(cx, |menu, cx| {
menu.context(self.focus_handle.clone()).map(|menu| {
@ -495,13 +496,15 @@ impl ProjectPanel {
menu.action("New File", Box::new(NewFile))
.action("New Folder", Box::new(NewDirectory))
.separator()
.when(cfg!(target_os = "macos"), |menu| {
.when(is_local && cfg!(target_os = "macos"), |menu| {
menu.action("Reveal in Finder", Box::new(RevealInFileManager))
})
.when(cfg!(not(target_os = "macos")), |menu| {
.when(is_local && cfg!(not(target_os = "macos")), |menu| {
menu.action("Reveal in File Manager", Box::new(RevealInFileManager))
})
.action("Open in Default App", Box::new(OpenWithSystem))
.when(is_local, |menu| {
menu.action("Open in Default App", Box::new(OpenWithSystem))
})
.action("Open in Terminal", Box::new(OpenInTerminal))
.when(is_dir, |menu| {
menu.separator()