Fixed: window content view was not inset from the frame

Previously, _CPStandardWindowView did not inset the content view rect
from the window frame, thus its contents could overlap the window frame.

Now the content view is correctly inset so that content view content
is clipped to the window frame, except for the corners. Because the
corners are round and the window frame is a background color, they
can still be overlapped. this will be fixed in a later commit.

Closes #1798
This commit is contained in:
Aparajita Fishman
2013-02-25 17:15:26 -05:00
parent 956a4c341c
commit b28429f940
+9
View File
@@ -124,8 +124,17 @@ var _CPStandardWindowViewDividerViewHeight = 1.0;
+ (CGRect)contentRectForFrameRect:(CGRect)aFrameRect
{
/*
This is the first window view class that draws a frame.
So we have to inset the content rect to be inside the frame.
The top coordinate has already been adjusted by _CPTitleableWindowView.
*/
var contentRect = [super contentRectForFrameRect:aFrameRect];
contentRect.origin.x += 1;
contentRect.size.width -= 2;
contentRect.size.height -= 1;
// Adjust for the divider
contentRect.origin.y += _CPStandardWindowViewDividerViewHeight;
contentRect.size.height -= _CPStandardWindowViewDividerViewHeight;