diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-11-14 18:34:20 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2020-11-14 18:34:20 +0200 |
commit | b55c5d8e93c5239d77e9afc1e15b2c7e9449d40e (patch) | |
tree | 33101f466bfe802bb03b5b9be9a6ed665523a87d /src/macos.m | |
parent | c11e09353ba7558f15958a01a0a4ac8f704d1ba5 (diff) |
macOS: Disable menu shortcuts while binding keys
Diffstat (limited to 'src/macos.m')
-rw-r--r-- | src/macos.m | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/macos.m b/src/macos.m index 28ebcc43..24a6fecb 100644 --- a/src/macos.m +++ b/src/macos.m | |||
@@ -491,6 +491,15 @@ void setupApplication_MacOS(void) { | |||
491 | windowCloseItem.action = @selector(closeTab); | 491 | windowCloseItem.action = @selector(closeTab); |
492 | } | 492 | } |
493 | 493 | ||
494 | void enableMenu_MacOS(const char *menuLabel, iBool enable) { | ||
495 | NSApplication *app = [NSApplication sharedApplication]; | ||
496 | NSMenu *appMenu = [app mainMenu]; | ||
497 | NSString *label = [NSString stringWithUTF8String:menuLabel]; | ||
498 | NSMenuItem *menuItem = [appMenu itemAtIndex:[appMenu indexOfItemWithTitle:label]]; | ||
499 | [menuItem setEnabled:enable]; | ||
500 | [label release]; | ||
501 | } | ||
502 | |||
494 | void insertMenuItems_MacOS(const char *menuLabel, int atIndex, const iMenuItem *items, size_t count) { | 503 | void insertMenuItems_MacOS(const char *menuLabel, int atIndex, const iMenuItem *items, size_t count) { |
495 | NSApplication *app = [NSApplication sharedApplication]; | 504 | NSApplication *app = [NSApplication sharedApplication]; |
496 | MyDelegate *myDel = (MyDelegate *) app.delegate; | 505 | MyDelegate *myDel = (MyDelegate *) app.delegate; |