From 7aa00a961a6665ea99cd99ba5fd40e7710982689 Mon Sep 17 00:00:00 2001 From: Randall Luecke Date: Wed, 29 Dec 2010 19:45:09 -0600 Subject: [PATCH] Attached sheets should have a shadow. --- AppKit/CPWindow/_CPDocModalWindowView.j | 9 ++++++++- .../CPWindow/CPWindowAttachedSheetShadow.png | Bin 0 -> 183 bytes 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 AppKit/Resources/CPWindow/CPWindowAttachedSheetShadow.png diff --git a/AppKit/CPWindow/_CPDocModalWindowView.j b/AppKit/CPWindow/_CPDocModalWindowView.j index 221fbe011..a23b78bbc 100644 --- a/AppKit/CPWindow/_CPDocModalWindowView.j +++ b/AppKit/CPWindow/_CPDocModalWindowView.j @@ -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; diff --git a/AppKit/Resources/CPWindow/CPWindowAttachedSheetShadow.png b/AppKit/Resources/CPWindow/CPWindowAttachedSheetShadow.png new file mode 100644 index 0000000000000000000000000000000000000000..836eb6a16f0e2a7d9cdf2ba9b435e3222a2e4052 GIT binary patch literal 183 zcmeAS@N?(olHy`uVBq!ia0vp^oIuRM!N$PA7<1~WGLR!#;u=vBoS#-wo>-L1;Fyx1 zl&avFo0y&&l$w}QS$Hzl2B;{~)5S5Q;#N{hLP7^)5?ccU(?W>`h9nlDNd|Hb42Fl6 zJXplQ$dYu!cmd-C1@2u6Krtoh(+r^>C1P7u;))rVcvJ)qI50Gn+)-M>ks_q;==%Tv efAuA8j12n}*!2t