summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/tab_strip_view.mm
blob: b54ef9df72a746ee50ed5b0565ae2d80bb633ecf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/cocoa/tab_strip_view.h"

@implementation TabStripView

- (id)initWithFrame:(NSRect)frame {
  self = [super initWithFrame:frame];
  if (self) {
    // Nothing yet to do here...
  }
  return self;
}

- (void)drawRect:(NSRect)rect {
  rect = [self bounds];
  BOOL isKey = [[self window] isKeyWindow];
  if (isKey) {
    NSGradient *gradient =
          [[[NSGradient alloc] initWithStartingColor:
              [NSColor colorWithCalibratedWhite:0.0 alpha:0.0]
                                        endingColor:
              [NSColor colorWithCalibratedWhite:0.0 alpha:0.05]] autorelease];
    [gradient drawInRect:[self bounds] angle:270.0];
  }

  NSRect borderRect, contentRect;
  NSDivideRect(rect, &borderRect, &contentRect, 1, NSMinYEdge);
  [[NSColor colorWithCalibratedWhite:0.0 alpha:0.2] set];

  NSRectFillUsingOperation(borderRect, NSCompositeSourceOver);
}

@end