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 @@ find_app_name(void) {
set_cocoa_pending_action(NEW_OS_WINDOW, NULL); 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 + (GlobalMenuTarget *) shared_instance
{ {
@ -313,6 +318,18 @@ cocoa_create_global_menu(void) {
[NSApp setWindowsMenu:windowMenu]; [NSApp setWindowsMenu:windowMenu];
[windowMenu release]; [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]; [bar release];
class_addMethod( class_addMethod(