mirror of
https://github.com/darlinghq/darling-cocotron.git
synced 2024-11-27 05:50:27 +00:00
Put only one separator item between the steady upper part of the "Windows" menu and its dynamic lower part that lists the open windows.
This commit is contained in:
parent
0c666b973e
commit
f1b3200ae7
@ -169,10 +169,13 @@ id NSApp=nil;
|
||||
}
|
||||
|
||||
-(NSMenu *)windowsMenu {
|
||||
if(_windowsMenu==nil)
|
||||
if(_windowsMenu==nil) {
|
||||
_windowsMenu=[[NSApp mainMenu] _menuWithName:@"_NSWindowsMenu"];
|
||||
|
||||
return _windowsMenu;
|
||||
if (_windowsMenu && ![[[_windowsMenu itemArray] lastObject] isSeparatorItem])
|
||||
[_windowsMenu addItem:[NSMenuItem separatorItem]];
|
||||
}
|
||||
|
||||
return _windowsMenu;
|
||||
}
|
||||
|
||||
-(NSWindow *)mainWindow {
|
||||
@ -314,15 +317,13 @@ id NSApp=nil;
|
||||
_windowsMenu=[menu retain];
|
||||
}
|
||||
|
||||
|
||||
-(void)addWindowsItem:(NSWindow *)window title:(NSString *)title filename:(BOOL)isFilename {
|
||||
NSMenuItem *item;
|
||||
|
||||
if ([[self windowsMenu] indexOfItemWithTarget:window andAction:@selector(makeKeyAndOrderFront:)] != -1)
|
||||
return;
|
||||
|
||||
if (![[[[self windowsMenu] itemArray] lastObject] isSeparatorItem])
|
||||
[[self windowsMenu] addItem:[NSMenuItem separatorItem]];
|
||||
|
||||
if (isFilename)
|
||||
title = [NSString stringWithFormat:@"%@ -- %@", [title lastPathComponent],[title stringByDeletingLastPathComponent]];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user