Implement default macOS menu items

- `Zed -> Hide`, bound to `cmd-h`
- `Zed -> Hide Others`, bound to `alt-cmd-h`
- `Zed -> Show All`
- `Window -> Minimize`, bound to `cmd-m`
- `Window -> Zoom`
This commit is contained in:
Antonio Scandurra 2022-08-03 15:13:30 +02:00
parent dc9df64078
commit 7cbf76ce80
8 changed files with 124 additions and 1 deletions

View file

@ -45,6 +45,18 @@ pub fn menus() -> Vec<Menu<'static>> {
action: Box::new(super::InstallCommandLineInterface),
},
MenuItem::Separator,
MenuItem::Action {
name: "Hide Zed",
action: Box::new(super::Hide),
},
MenuItem::Action {
name: "Hide Others",
action: Box::new(super::HideOthers),
},
MenuItem::Action {
name: "Show All",
action: Box::new(super::ShowAll),
},
MenuItem::Action {
name: "Quit",
action: Box::new(super::Quit),
@ -244,6 +256,7 @@ pub fn menus() -> Vec<Menu<'static>> {
name: "Diagnostics",
action: Box::new(diagnostics::Deploy),
},
MenuItem::Separator,
],
},
Menu {
@ -299,7 +312,17 @@ pub fn menus() -> Vec<Menu<'static>> {
},
Menu {
name: "Window",
items: vec![MenuItem::Separator],
items: vec![
MenuItem::Action {
name: "Minimize",
action: Box::new(super::Minimize),
},
MenuItem::Action {
name: "Zoom",
action: Box::new(super::Zoom),
},
MenuItem::Separator,
],
},
Menu {
name: "Help",