GSWindowDecorationView merge

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@38703 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Marcian Lytwyn 2015-06-26 16:59:32 +00:00
parent 302adee8ba
commit fbbca0182c

View file

@ -353,19 +353,41 @@ static inline NSRect RectWithSizeScaledByFactor(NSRect aRect, CGFloat factor)
{ {
NSRect orgWindowFrame; NSRect orgWindowFrame;
NSRect windowFrame; NSRect windowFrame;
NSRect windowContentFrame;
if (difference != 0.0) // FIXME: This is needed as long as NSWindow uses fraem limits not content frame limits
NSSize aSize = [window minSize];
if (!NSEqualSizes(aSize, NSZeroSize))
{ {
aSize.height += difference;
[window setMinSize: aSize];
}
aSize = [window maxSize];
if (!NSEqualSizes(aSize, NSZeroSize))
{
aSize.height += difference;
[window setMaxSize: aSize];
}
contentRect.size.height += difference; contentRect.size.height += difference;
windowFrame = [object_getClass(self)
frameRectForContentRect: contentRect
styleMask: [window styleMask]];
// Set the local frame without changing the contents view
windowContentFrame = windowFrame;
windowContentFrame.origin = NSZeroPoint;
_autoresizes_subviews = NO;
[super setFrame: windowContentFrame];
// Keep the top of the window at the same place // Keep the top of the window at the same place
orgWindowFrame = [window frame]; orgWindowFrame = [window frame];
windowFrame = orgWindowFrame;
windowFrame.origin.y = orgWindowFrame.origin.y + orgWindowFrame.size.height - windowFrame.size.height; windowFrame.origin.y = orgWindowFrame.origin.y + orgWindowFrame.size.height - windowFrame.size.height;
windowFrame.origin.x = orgWindowFrame.origin.x; windowFrame.origin.x = orgWindowFrame.origin.x;
windowFrame.size.height += difference;
// then resize the window
[window setFrame: windowFrame display: YES]; [window setFrame: windowFrame display: YES];
} [self layout];
} }
/* /*