Fix macOS App shortcut (#18921)

- The App Shortcuts in macOS System Settings does not work for Zed since the menu items titles were not set.
- Previously you could set a shortcut for `Zoom`.
- This add support for `Window->Zoom` as well.
This commit is contained in:
Henry Chu 2024-10-11 01:08:46 +08:00 committed by GitHub
parent 3c6989323f
commit eea600ecc3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -216,7 +216,8 @@ impl MacPlatform {
for menu_config in menus {
let menu = NSMenu::new(nil).autorelease();
menu.setTitle_(ns_string(&menu_config.name));
let menu_title = ns_string(&menu_config.name);
menu.setTitle_(menu_title);
menu.setDelegate_(delegate);
for item_config in menu_config.items {
@ -229,6 +230,7 @@ impl MacPlatform {
}
let menu_item = NSMenuItem::new(nil).autorelease();
menu_item.setTitle_(menu_title);
menu_item.setSubmenu_(menu);
application_menu.addItem_(menu_item);