winemac: Add Hide, Hide Others, and Show All items to the application menu.

This commit is contained in:
Ken Thomases 2013-05-29 10:30:41 -05:00 committed by Alexandre Julliard
parent c3d2e43060
commit d8269a0586
1 changed files with 16 additions and 0 deletions

View File

@ -205,8 +205,23 @@ - (void) transformProcessToForeground
mainMenu = [[[NSMenu alloc] init] autorelease];
// Application menu
submenu = [[[NSMenu alloc] initWithTitle:@"Wine"] autorelease];
bundleName = [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*)kCFBundleNameKey];
if ([bundleName length])
title = [NSString stringWithFormat:@"Hide %@", bundleName];
else
title = @"Hide";
item = [submenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@""];
item = [submenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
[item setKeyEquivalentModifierMask:NSCommandKeyMask | NSAlternateKeyMask];
item = [submenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];
[submenu addItem:[NSMenuItem separatorItem]];
if ([bundleName length])
title = [NSString stringWithFormat:@"Quit %@", bundleName];
else
@ -218,6 +233,7 @@ - (void) transformProcessToForeground
[item setSubmenu:submenu];
[mainMenu addItem:item];
// Window menu
submenu = [[[NSMenu alloc] initWithTitle:@"Window"] autorelease];
[submenu addItemWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@""];
[submenu addItemWithTitle:@"Zoom" action:@selector(performZoom:) keyEquivalent:@""];