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

Unified Diff: chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm

Issue 11791030: mac: New asset for the tabstrip border, tweak drawing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: round2 Created 7 years, 11 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/image_button_cell.mm ('k') | chrome/browser/ui/cocoa/tabs/tab_strip_view.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
index dfb04d24ee697530b224a93a6f8a18e1aa4cee66..2477943ef5d4e09e8588343cf499dff045f77472 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm
@@ -222,7 +222,7 @@ NSImage* ApplyMask(NSImage* image, NSImage* mask) {
}
// Paints |overlay| on top of |ground|.
-NSImage* Overlay(NSImage* ground, NSImage* overlay) {
+NSImage* Overlay(NSImage* ground, NSImage* overlay, CGFloat alpha) {
DCHECK_EQ([ground size].width, [overlay size].width);
DCHECK_EQ([ground size].height, [overlay size].height);
@@ -236,7 +236,7 @@ NSImage* Overlay(NSImage* ground, NSImage* overlay) {
[overlay drawAtPoint:NSZeroPoint
fromRect:NSMakeRect(0, 0, width, height)
operation:NSCompositeSourceOver
- fraction:1.0];
+ fraction:alpha];
}) autorelease];
}
@@ -2204,20 +2204,21 @@ NSImage* Overlay(NSImage* ground, NSImage* overlay) {
NSImage* foreground = ApplyMask(
theme->GetNSImageNamed(IDR_THEME_TAB_BACKGROUND, true), mask);
- [[newTabButton_ cell] setImage:Overlay(foreground, normal)
+ [[newTabButton_ cell] setImage:Overlay(foreground, normal, 1.0)
forButtonState:image_button_cell::kDefaultState];
- [[newTabButton_ cell] setImage:Overlay(foreground, hover)
+ [[newTabButton_ cell] setImage:Overlay(foreground, hover, 1.0)
forButtonState:image_button_cell::kHoverState];
- [[newTabButton_ cell] setImage:Overlay(foreground, pressed)
+ [[newTabButton_ cell] setImage:Overlay(foreground, pressed, 1.0)
forButtonState:image_button_cell::kPressedState];
// IDR_THEME_TAB_BACKGROUND_INACTIVE is only used with the default theme.
if (theme->UsingDefaultTheme()) {
+ const CGFloat alpha = tabs::kImageNoFocusAlpha;
NSImage* background = ApplyMask(
theme->GetNSImageNamed(IDR_THEME_TAB_BACKGROUND_INACTIVE, true), mask);
- [[newTabButton_ cell] setImage:Overlay(background, normal)
+ [[newTabButton_ cell] setImage:Overlay(background, normal, alpha)
forButtonState:image_button_cell::kDefaultStateBackground];
- [[newTabButton_ cell] setImage:Overlay(background, hover)
+ [[newTabButton_ cell] setImage:Overlay(background, hover, alpha)
forButtonState:image_button_cell::kHoverStateBackground];
} else {
[[newTabButton_ cell] setImage:nil
« no previous file with comments | « chrome/browser/ui/cocoa/image_button_cell.mm ('k') | chrome/browser/ui/cocoa/tabs/tab_strip_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698