OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "chrome/browser/ui/cocoa/hover_close_button.h" | 5 #import "chrome/browser/ui/cocoa/hover_close_button.h" |
6 | 6 |
7 #include "base/memory/scoped_nsobject.h" | 7 #include "base/memory/scoped_nsobject.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #import "chrome/browser/ui/cocoa/animation_utils.h" | 9 #import "chrome/browser/ui/cocoa/animation_utils.h" |
10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 [[NSColor whiteColor] set]; | 308 [[NSColor whiteColor] set]; |
309 [xPath fill]; | 309 [xPath fill]; |
310 | 310 |
311 // Give the 'x' an inner shadow for depth. If the button is in a hover state | 311 // Give the 'x' an inner shadow for depth. If the button is in a hover state |
312 // (circle behind it), then adjust the shadow accordingly (not as harsh). | 312 // (circle behind it), then adjust the shadow accordingly (not as harsh). |
313 NSShadow* shadow = [[[NSShadow alloc] init] autorelease]; | 313 NSShadow* shadow = [[[NSShadow alloc] init] autorelease]; |
314 CGFloat alpha = (hoverState != kHoverStateNone) ? | 314 CGFloat alpha = (hoverState != kHoverStateNone) ? |
315 kXShadowCircleAlpha : kXShadowAlpha; | 315 kXShadowCircleAlpha : kXShadowAlpha; |
316 [shadow setShadowColor:[NSColor colorWithCalibratedWhite:0.15 alpha:alpha]]; | 316 [shadow setShadowColor:[NSColor colorWithCalibratedWhite:0.15 alpha:alpha]]; |
317 [shadow setShadowOffset:NSMakeSize(0.0, 0.0)]; | 317 [shadow setShadowOffset:NSMakeSize(0.0, 0.0)]; |
318 [shadow setShadowBlurRadius:2.75 * scale]; | 318 [shadow setShadowBlurRadius:2.5]; |
319 [xPath fillWithInnerShadow:shadow scale:scale]; | 319 [xPath fillWithInnerShadow:shadow]; |
320 return imageRep; | 320 return imageRep; |
321 } | 321 } |
322 | 322 |
323 @end | 323 @end |
OLD | NEW |