Commit 95b2a7c4 authored by jeremya@chromium.org's avatar jeremya@chromium.org

[mac] In app windows, calculate the rounded corner radius programmatically.

R=rsesek@chromium.org


Review URL: https://chromiumcodereview.appspot.com/10823008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148458 0039d316-1c4b-4281-b951-d872f2087c98
parent e776763a
......@@ -56,16 +56,26 @@
@end
// This is really a method on NSGrayFrame, so it should only be called on the
// view passed into -[NSWindow drawCustomFrameRect:forView:].
@interface NSView (PrivateMethods)
- (CGFloat)roundedCornerRadius;
@end
@implementation ShellNSWindow
- (void)drawCustomFrameRect:(NSRect)rect forView:(NSView*)view {
[[NSBezierPath bezierPathWithRect:rect] addClip];
[[NSColor clearColor] set];
NSRectFill(rect);
const CGFloat kWindowBorderRadius = 3.0;
// Set up our clip.
CGFloat cornerRadius = 4.0;
if ([view respondsToSelector:@selector(roundedCornerRadius)])
cornerRadius = [view roundedCornerRadius];
[[NSBezierPath bezierPathWithRoundedRect:[view bounds]
xRadius:kWindowBorderRadius
yRadius:kWindowBorderRadius] addClip];
xRadius:cornerRadius
yRadius:cornerRadius] addClip];
[[NSColor whiteColor] set];
NSRectFill(rect);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment