Attached sheets should have a shadow.

This commit is contained in:
Randall Luecke
2010-12-29 19:45:09 -06:00
parent 4b653ee367
commit 7aa00a961a
2 changed files with 8 additions and 1 deletions
+8 -1
View File
@@ -6,6 +6,7 @@ var _CPStandardWindowViewBodyBackgroundColor = nil;
@implementation _CPDocModalWindowView : _CPWindowView
{
CPView _bodyView;
CPView _shadowView;
}
+ (CPColor)bodyBackgroundColor
@@ -25,13 +26,19 @@ var _CPStandardWindowViewBodyBackgroundColor = nil;
var theClass = [self class],
bounds = [self bounds];
_bodyView = [[CPView alloc] initWithFrame:CGRectMake(0.0, 0.0, CGRectGetWidth(bounds), CGRectGetHeight(bounds))];
_bodyView = [[CPView alloc] initWithFrame:_CGRectMake(0.0, 0.0, _CGRectGetWidth(bounds), _CGRectGetHeight(bounds))];
[_bodyView setAutoresizingMask:CPViewWidthSizable | CPViewHeightSizable];
[_bodyView setBackgroundColor:[theClass bodyBackgroundColor]];
[_bodyView setHitTests:NO];
[self addSubview:_bodyView];
var bundle = [CPBundle bundleForClass:[CPWindow class]];
_shadowView = [[CPView alloc] initWithFrame:CGRectMake(0, 0, _CGRectGetWidth(bounds), 8)];
[_shadowView setAutoresizingMask:CPViewWidthSizable];
[_shadowView setBackgroundColor:[CPColor colorWithPatternImage:[[CPImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CPWindow/CPWindowAttachedSheetShadow.png"] size:CGSizeMake(9,8)]]];
[self addSubview:_shadowView];
}
return self;
Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B