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

Unified Diff: chrome/browser/cocoa/tab_view.mm

Issue 2833014: Add a 1px white bezel under the dark line separating the tab strip and the to... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 6 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/cocoa/tab_strip_view.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/tab_view.mm
===================================================================
--- chrome/browser/cocoa/tab_view.mm (revision 49817)
+++ chrome/browser/cocoa/tab_view.mm (working copy)
@@ -609,11 +609,11 @@
BOOL active = [[self window] isKeyWindow] || [[self window] isMainWindow];
BOOL selected = [self state];
- // Inset by 0.5 in order to draw on pixels rather than on borders (which would
- // cause blurry pixels). Decrease height by 1 in order to move away from the
- // edge for the dark shadow.
+ // Outset by 0.5 in order to draw on pixels rather than on borders (which
+ // would cause blurry pixels). Subtract 1px of height to compensate,
+ // otherwise clipping will occur.
rect = NSInsetRect(rect, -0.5, -0.5);
- rect.origin.y -= 1;
+ rect.size.height -= 1;
NSPoint bottomLeft = NSMakePoint(NSMinX(rect), NSMinY(rect) + 2);
NSPoint bottomRight = NSMakePoint(NSMaxX(rect), NSMinY(rect) + 2);
@@ -756,14 +756,21 @@
[path stroke];
[context restoreGraphicsState];
- // Draw the bottom border.
+ // Mimic the tab strip's bottom border, which consists of a dark border
+ // and light highlight.
if (!selected) {
[path addClip];
- NSRect borderRect, contentRect;
- NSDivideRect(rect, &borderRect, &contentRect, 2.5, NSMinYEdge);
- [[NSColor colorWithDeviceWhite:0.0 alpha:active ? 0.3 : 0.15] set];
- NSRectFillUsingOperation(borderRect, NSCompositeSourceOver);
+ NSRect tempRect = rect;
rohitrao (ping after 24h) 2010/06/17 20:25:52 Call this something like fillRect instead of tempR
+ tempRect.origin.y = 1;
+ tempRect.size.height = 1;
+ [[NSColor colorWithDeviceWhite:0.0 alpha:active ? 0.2 : 0.15] set];
+ NSRectFillUsingOperation(tempRect, NSCompositeSourceOver);
+
+ tempRect.origin.y = 0;
+ [[NSColor colorWithCalibratedWhite:0.96 alpha:1.0] set];
+ NSRectFillUsingOperation(tempRect, NSCompositeSourceOver);
}
+
[context restoreGraphicsState];
}
« no previous file with comments | « chrome/browser/cocoa/tab_strip_view.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698