Merge original in-window menu branch.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33924 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fredkiefer 2011-10-01 11:17:16 +00:00
parent 92b44ffa68
commit 0de761d88e
4 changed files with 58 additions and 49 deletions

View file

@ -294,7 +294,7 @@ static inline NSRect RectWithSizeScaledByFactor(NSRect aRect, CGFloat factor)
if (hasMenu)
{
NSMenuView *menuView;
NSMenuView *menuView = nil;
GSTheme *theme = [GSTheme theme];
float menuBarHeight = [theme menuHeightForWindow: _window];
NSRect menuRect =
@ -302,8 +302,17 @@ static inline NSRect RectWithSizeScaledByFactor(NSRect aRect, CGFloat factor)
(NSMaxY(contentRect) + 1) - menuBarHeight,
contentViewFrame.size.width,
menuBarHeight);
menuView = [[_window menu] menuRepresentation];
NSEnumerator *e = [[self subviews] objectEnumerator];
NSView *v;
while ((v = [e nextObject]) != nil)
{
if ([v isKindOfClass: [NSMenuView class]] == YES)
{
menuView = (NSMenuView *)v;
break;
}
}
[menuView setFrame: menuRect];
contentViewFrame.size.height -= menuBarHeight;
}