Chromium Code Reviews| 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]; |
| } |