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:
dpsimons 2010-04-20 19:37:10 +00:00
parent 4f04ae9d0d
commit 259dc054b6
3 changed files with 14 additions and 15 deletions

View file

@ -1,3 +1,10 @@
2010-04-20 Doug Simons <doug.simons@testplant.com>
* Source/NSWindow.m:
* Source/GSWindowDecorationView.m:
Fix problems with in-window menus sometimes overlapping toolbars or
toolbars overlapping window contents.
2010-04-19 Doug Simons <doug.simons@testplant.com> 2010-04-19 Doug Simons <doug.simons@testplant.com>
* Source/NSMatrix.m: * Source/NSMatrix.m:

View file

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

View file

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