diff options
-rw-r--r-- | chrome/browser/cocoa/tab_strip_controller.mm | 2 | ||||
-rw-r--r-- | chrome/browser/cocoa/tab_strip_view.mm | 12 | ||||
-rw-r--r-- | chrome/browser/cocoa/tab_view.mm | 23 |
3 files changed, 26 insertions, 11 deletions
diff --git a/chrome/browser/cocoa/tab_strip_controller.mm b/chrome/browser/cocoa/tab_strip_controller.mm index b3efcb3..6bf651d 100644 --- a/chrome/browser/cocoa/tab_strip_controller.mm +++ b/chrome/browser/cocoa/tab_strip_controller.mm @@ -380,7 +380,7 @@ private: } + (CGFloat)defaultTabHeight { - return 24.0; + return 25.0; } + (CGFloat)defaultIndentForControls { diff --git a/chrome/browser/cocoa/tab_strip_view.mm b/chrome/browser/cocoa/tab_strip_view.mm index a5d61f6..25ed090 100644 --- a/chrome/browser/cocoa/tab_strip_view.mm +++ b/chrome/browser/cocoa/tab_strip_view.mm @@ -31,9 +31,17 @@ - (void)drawRect:(NSRect)rect { NSRect boundsRect = [self bounds]; NSRect borderRect, contentRect; - NSDivideRect(boundsRect, &borderRect, &contentRect, 1, NSMinYEdge); - [[NSColor colorWithCalibratedWhite:0.0 alpha:0.2] set]; + // Draw bottom border (a dark border and light highlight). Each tab is + // responsible for mimicing this bottom border, unless it's the selected + // tab. + borderRect = boundsRect; + borderRect.origin.y = 1; + borderRect.size.height = 1; + [[NSColor colorWithCalibratedWhite:0.0 alpha:0.2] set]; + NSRectFillUsingOperation(borderRect, NSCompositeSourceOver); + NSDivideRect(boundsRect, &borderRect, &contentRect, 1, NSMinYEdge); + [[NSColor colorWithCalibratedWhite:0.96 alpha:1.0] set]; NSRectFillUsingOperation(borderRect, NSCompositeSourceOver); // Draw drop-indicator arrow (if appropriate). diff --git a/chrome/browser/cocoa/tab_view.mm b/chrome/browser/cocoa/tab_view.mm index cf39163..8e4c8e3 100644 --- a/chrome/browser/cocoa/tab_view.mm +++ b/chrome/browser/cocoa/tab_view.mm @@ -609,11 +609,11 @@ const CGFloat kRapidCloseDist = 2.5; 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 @@ const CGFloat kRapidCloseDist = 2.5; [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]; + NSRect borderRect = rect; + borderRect.origin.y = 1; + borderRect.size.height = 1; + [[NSColor colorWithDeviceWhite:0.0 alpha:active ? 0.2 : 0.15] set]; + NSRectFillUsingOperation(borderRect, NSCompositeSourceOver); + + borderRect.origin.y = 0; + [[NSColor colorWithCalibratedWhite:0.96 alpha:1.0] set]; NSRectFillUsingOperation(borderRect, NSCompositeSourceOver); } + [context restoreGraphicsState]; } |