* 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:
Fred Kiefer 2012-02-01 09:12:34 +00:00
parent 1b398c6621
commit 462b24489f
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>
* Source/GSThemeInspector.m (-update:): Don't get the frame from a

View file

@ -1997,6 +1997,16 @@ static BOOL menuBarVisible = YES;
{
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];
if (newStyle == NSMacintoshInterfaceStyle
|| newStyle == NSWindows95InterfaceStyle)
@ -2011,11 +2021,11 @@ static BOOL menuBarVisible = YES;
[self setMenuRepresentation: newRep];
[self _organizeMenu];
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 _setGeometry];
[self sizeToFit];
}
else
{
/* Put menu in all main windows for microsoft style.
*/
[[GSTheme theme] updateAllWindowsWithMenu: self];
}
if ([NSApp isActive])
{
[self display];
if ([NSApp isActive])
{
[self display];
}
}
}
else
{
[self close];
[[self window] setLevel: NSSubmenuWindowLevel];
}
}