Merge branch 'add_macos_help_menu_item' of https://github.com/Luflosi/kitty

This commit is contained in:
Kovid Goyal 2019-12-29 22:03:08 +05:30
commit 003f77b257
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -83,6 +83,11 @@ - (void)new_os_window:(id)sender {
set_cocoa_pending_action(NEW_OS_WINDOW, NULL);
}
- (void)open_kitty_website_url:(id)sender {
(void)sender;
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"https://sw.kovidgoyal.net/kitty/"]];
}
+ (GlobalMenuTarget *) shared_instance
{
@ -313,6 +318,18 @@ - (void)openFilesFromPasteboard:(NSPasteboard *)pasteboard type:(int)type {
[NSApp setWindowsMenu:windowMenu];
[windowMenu release];
NSMenuItem* helpMenuItem =
[bar addItemWithTitle:@"Help"
action:NULL
keyEquivalent:@""];
NSMenu* helpMenu = [[NSMenu alloc] initWithTitle:@"Help"];
[helpMenuItem setSubmenu:helpMenu];
[[helpMenu addItemWithTitle:[NSString stringWithFormat:@"Visit %@ website", app_name]
action:@selector(open_kitty_website_url:)
keyEquivalent:@"?"]
setTarget:global_menu_target];
[helpMenu release];
[bar release];
class_addMethod(