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

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

Issue 11791030: mac: New asset for the tabstrip border, tweak drawing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tweak 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
Index: chrome/browser/ui/cocoa/tabs/tab_strip_view.mm
diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_view.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_view.mm
index 35d3c091dd0151e93c9a03fedfbe569a39701302..0bc50071b4ace4e379ca0574bfd1ff0753e33245 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_strip_view.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_strip_view.mm
@@ -19,6 +19,10 @@
#include "ui/base/l10n/l10n_util_mac.h"
#include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
+// When the window doesn't have focus then we want to draw the button with a
+// slightly lighter color. We do this by just reducing the alpha.
+const CGFloat kImageNoFocusAlpha = 0.65;
+
@implementation TabStripView
@synthesize dropArrowShown = dropArrowShown_;
@@ -75,8 +79,10 @@
borderRect.size.height = [image size].height;
borderRect.origin.y = 0;
- NSDrawThreePartImage(borderRect, nil, image, nil, /*vertical=*/NO,
- NSCompositeSourceOver, 1.0, /*flipped=*/NO);
+ bool active = [[self window] isKeyWindow] || [[self window] isMainWindow];
+ NSDrawThreePartImage(borderRect, nil, image, nil, /*vertical=*/ NO,
+ NSCompositeSourceOver,
+ active ? 1.0 : kImageNoFocusAlpha, /*flipped=*/ NO);
}
- (void)drawRect:(NSRect)rect {

Powered by Google App Engine
This is Rietveld 408576698