Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(556)

Side by Side Diff: chrome/browser/ui/cocoa/fullscreen_exit_bubble_view.mm

Issue 8425007: Make the shadow for the fullscreen exit bubble for mac more prominent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: UI tweaks Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/cocoa/fullscreen_exit_bubble_view.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #import "chrome/browser/ui/cocoa/fullscreen_exit_bubble_view.h"
6
7 namespace {
8
9 const CGFloat kShadowTop = 20;
10 const CGFloat kShadowBottom = 50;
11 const CGFloat kShadowLeft = 50;
12 const CGFloat kShadowRight = 50;
13 const CGFloat kShadowBlurRadius = 290;
14 const CGFloat kShadowAlpha = 0.3;
15 const CGFloat kBubbleCornerRadius = 8.0;
16
17 }
18
19 @implementation FullscreenExitBubbleView
20
21 - (void)drawRect:(NSRect)rect {
22 // Make room for the border to be seen.
23 NSRect bounds = [self bounds];
24 bounds.size.width -= kShadowLeft + kShadowRight;
25 bounds.size.height -= kShadowTop + kShadowBottom;
26 bounds.origin.x += kShadowLeft;
27 bounds.origin.y += kShadowBottom;
28 NSBezierPath* bezier = [NSBezierPath bezierPath];
29
30 CGFloat radius = kBubbleCornerRadius;
31 // Start with a rounded rectangle.
32 [bezier appendBezierPathWithRoundedRect:bounds
33 xRadius:radius
34 yRadius:radius];
35
36 [bezier closePath];
37 [[NSColor whiteColor] set];
38 [NSGraphicsContext saveGraphicsState];
Nico 2011/11/01 07:19:39 Consider using ui/gfx/scoped_ns_graphics_context_s
koz (OOO until 15th September) 2011/11/01 23:52:14 Done.
39 NSShadow* theShadow = [[NSShadow alloc] init];
40 [theShadow setShadowBlurRadius:kShadowBlurRadius];
41 [theShadow setShadowColor:[[NSColor blackColor]
42 colorWithAlphaComponent:kShadowAlpha]];
43 [theShadow set];
44
45 [bezier fill];
46
47 [NSGraphicsContext restoreGraphicsState];
48 [theShadow release];
Nico 2011/11/01 07:19:39 Make theShadow a scoped_nsobject instead. Also, ca
koz (OOO until 15th September) 2011/11/01 23:52:14 Done.
49 }
50
51 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/fullscreen_exit_bubble_view.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698