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

Unified Diff: chrome/browser/ui/cocoa/tabs/tab_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: 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/tabs/tab_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/tabs/tab_view.mm
diff --git a/chrome/browser/ui/cocoa/tabs/tab_view.mm b/chrome/browser/ui/cocoa/tabs/tab_view.mm
index 09733c3a3656b8f6d8bc699f649523d49fbaa1e6..3657ca602293a0269140473c09d903884e32137d 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_view.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_view.mm
@@ -24,8 +24,6 @@
@end
#endif
-namespace {
-
const int kMaskHeight = 29; // Height of the mask bitmap.
const int kFillHeight = 25; // Height of the "mask on" part of the mask bitmap.
@@ -52,8 +50,6 @@ const NSTimeInterval kGlowUpdateInterval = 0.025;
// has moved less than the threshold, we want to close the tab.
const CGFloat kRapidCloseDist = 2.5;
-} // namespace
-
@interface TabView(Private)
- (void)resetLastGlowUpdateTime;
@@ -327,6 +323,11 @@ const CGFloat kRapidCloseDist = 2.5;
bool selected = [self state];
+ // Background tabs should not paint over the tab strip separator, which is
+ // two pixels high in both lodpi and hidpi.
+ if (!selected && dirtyRect.origin.y < 1)
+ dirtyRect.origin.y = 2 * [self cr_lineWidth];
+
bool usingDefaultTheme = themeProvider && themeProvider->UsingDefaultTheme();
NSColor* backgroundImageColor = [self backgroundColorForSelected:selected];
@@ -405,6 +406,9 @@ const CGFloat kRapidCloseDist = 2.5;
// Draws the tab outline.
- (void)drawStroke:(NSRect)dirtyRect {
+ BOOL focused = [[self window] isKeyWindow] || [[self window] isMainWindow];
+ CGFloat alpha = focused ? 1.0 : tabs::kImageNoFocusAlpha;
+
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
float height =
[rb.GetNativeImageNamed(IDR_TAB_ACTIVE_LEFT).ToNSImage() size].height;
@@ -415,7 +419,7 @@ const CGFloat kRapidCloseDist = 2.5;
rb.GetNativeImageNamed(IDR_TAB_ACTIVE_RIGHT).ToNSImage(),
/*vertical=*/NO,
NSCompositeSourceOver,
- 1.0,
+ alpha,
/*flipped=*/NO);
} else {
NSDrawThreePartImage(NSMakeRect(0, 0, NSWidth([self bounds]), height),
@@ -424,7 +428,7 @@ const CGFloat kRapidCloseDist = 2.5;
rb.GetNativeImageNamed(IDR_TAB_INACTIVE_RIGHT).ToNSImage(),
/*vertical=*/NO,
NSCompositeSourceOver,
- 1.0,
+ alpha,
/*flipped=*/NO);
}
}
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698