fix problems with overlaps between toolbars, window contents, and in-window menus

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30206 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Doug Simons 2010-04-20 19:37:10 +00:00
parent aa0ce37f5d
commit 34f7052ac2
3 changed files with 14 additions and 15 deletions

View file

@ -213,17 +213,9 @@
- (void) setContentView: (NSView *)contentView
{
NSSize oldSize;
[contentView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
[self addSubview: contentView];
oldSize = [contentView frame].size;
oldSize.width += _frame.size.width - contentRect.size.width;
oldSize.height += _frame.size.height - contentRect.size.height;
[contentView resizeWithOldSuperviewSize: oldSize];
[contentView setFrameOrigin: NSMakePoint(contentRect.origin.x,
contentRect.origin.y)];
[self layout];
}
- (void) setDocumentEdited: (BOOL)flag
@ -239,6 +231,7 @@
NSRect contentViewFrame;
NSToolbar *tb = [_window toolbar];
NSRect frame = [window frame];
NSView *windowContentView = [_window contentView];
frame.origin = NSZeroPoint;
contentViewFrame = [isa contentRectForFrameRect: frame
@ -282,6 +275,10 @@
contentViewFrame.size.height -= newToolbarViewHeight;
}
}
if ([windowContentView superview] == self)
{
[windowContentView setFrame:contentViewFrame];
}
}
- (void) changeWindowHeight: (float)difference
@ -307,6 +304,7 @@
// then resize the window
[window setFrame: windowFrame display: YES];
[self layout];
}
/*

View file

@ -1816,12 +1816,6 @@ many times.
{
[_wv setInputState: GSTitleBarNormal];
}
if ([self menu] == [NSApp mainMenu])
{
/* This window contains the main menu ... remove it.
*/
[self setMenu: nil];
}
[nc postNotificationName: NSWindowDidResignMainNotification object: self];
}
}