summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-17 20:52:12 +0000
committerpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-17 20:52:12 +0000
commit4cc9a1751f50ee33ec0ddcd00267ac7edfc270b9 (patch)
treeda2717c4ee749b8be3627f34273f85274a6beca0 /chrome
parente9125d2d9dc3b8c99df4bcc0ce5e10c98f6fca51 (diff)
downloadchromium_src-4cc9a1751f50ee33ec0ddcd00267ac7edfc270b9.zip
chromium_src-4cc9a1751f50ee33ec0ddcd00267ac7edfc270b9.tar.gz
chromium_src-4cc9a1751f50ee33ec0ddcd00267ac7edfc270b9.tar.bz2
Add a 1px white bezel under the dark line separating the tab strip and the toolbar. Tabs are now responsible for mimicing this line when drawing unselected.
BUG=44574 TEST=none. Review URL: http://codereview.chromium.org/2833014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50137 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/cocoa/tab_strip_controller.mm2
-rw-r--r--chrome/browser/cocoa/tab_strip_view.mm12
-rw-r--r--chrome/browser/cocoa/tab_view.mm23
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];
}