* Source/NSMenu.m (-setMain:): Rearrange code to avoid duplicate

menu for in-window menu themes.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@34687 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fredkiefer 2012-02-01 09:12:34 +00:00
parent 94e4660f98
commit b1db7ee743
2 changed files with 23 additions and 15 deletions

View file

@ -1,3 +1,8 @@
2012-02-01 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSMenu.m (-setMain:): Rearrange code to avoid duplicate
menu for in-window menu themes.
2012-02-01 Fred Kiefer <FredKiefer@gmx.de> 2012-02-01 Fred Kiefer <FredKiefer@gmx.de>
* Source/GSThemeInspector.m (-update:): Don't get the frame from a * Source/GSThemeInspector.m (-update:): Don't get the frame from a

View file

@ -1997,6 +1997,16 @@ static BOOL menuBarVisible = YES;
{ {
NSMenuView *newRep; NSMenuView *newRep;
if (oldStyle == NSWindows95InterfaceStyle)
{
/* Remove the menu from all main windows.
*/
[[GSTheme theme] updateAllWindowsWithMenu: nil];
}
if (newStyle == NSWindows95InterfaceStyle)
{
[self close];
}
newRep = [[NSMenuView alloc] initWithFrame: NSZeroRect]; newRep = [[NSMenuView alloc] initWithFrame: NSZeroRect];
if (newStyle == NSMacintoshInterfaceStyle if (newStyle == NSMacintoshInterfaceStyle
|| newStyle == NSWindows95InterfaceStyle) || newStyle == NSWindows95InterfaceStyle)
@ -2011,11 +2021,11 @@ static BOOL menuBarVisible = YES;
[self setMenuRepresentation: newRep]; [self setMenuRepresentation: newRep];
[self _organizeMenu]; [self _organizeMenu];
RELEASE(newRep); RELEASE(newRep);
if (oldStyle == NSWindows95InterfaceStyle) if (newStyle == NSWindows95InterfaceStyle)
{ {
/* Remove the menu from all main windows. /* Put menu in all main windows for microsoft style.
*/ */
[[GSTheme theme] updateAllWindowsWithMenu: nil]; [[GSTheme theme] updateAllWindowsWithMenu: self];
} }
} }
@ -2028,22 +2038,15 @@ static BOOL menuBarVisible = YES;
[[self window] setLevel: NSMainMenuWindowLevel]; [[self window] setLevel: NSMainMenuWindowLevel];
[self _setGeometry]; [self _setGeometry];
[self sizeToFit]; [self sizeToFit];
}
else if ([NSApp isActive])
{ {
/* Put menu in all main windows for microsoft style. [self display];
*/ }
[[GSTheme theme] updateAllWindowsWithMenu: self];
}
if ([NSApp isActive])
{
[self display];
} }
} }
else else
{ {
[self close];
[[self window] setLevel: NSSubmenuWindowLevel]; [[self window] setLevel: NSSubmenuWindowLevel];
} }
} }