| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #import "chrome/browser/cocoa/download_shelf_view.h" |
| 6 |
| 7 #include "base/scoped_nsobject.h" |
| 8 |
| 9 @implementation DownloadShelfView |
| 10 |
| 11 - (void)drawRect:(NSRect)rect { |
| 12 rect = [self bounds]; |
| 13 |
| 14 // TODO(thakis): Once this has its final look, it also needs an |
| 15 // "inactive" state. |
| 16 |
| 17 #if 0 |
| 18 // Grey Finder/iCal-like bottom bar with dark gradient, dark/light lines |
| 19 NSColor* start = |
| 20 [NSColor colorWithCalibratedWhite: 0.75 alpha:1.0]; |
| 21 NSColor* end = [NSColor colorWithCalibratedWhite:0.59 alpha:1.0]; |
| 22 scoped_nsobject<NSGradient> gradient( |
| 23 [[NSGradient alloc] initWithStartingColor:start endingColor:end]); |
| 24 [gradient drawInRect:[self bounds] angle:270.0]; |
| 25 |
| 26 NSRect borderRect, contentRect; |
| 27 NSDivideRect(rect, &borderRect, &contentRect, 1, NSMaxYEdge); |
| 28 [[NSColor colorWithDeviceWhite:0.25 alpha:1.0] set]; |
| 29 NSRectFillUsingOperation(borderRect, NSCompositeSourceOver); |
| 30 |
| 31 NSDivideRect(contentRect, &borderRect, &contentRect, 1, NSMaxYEdge); |
| 32 [[NSColor colorWithDeviceWhite:0.85 alpha:1.0] set]; |
| 33 NSRectFillUsingOperation(borderRect, NSCompositeSourceOver); |
| 34 #else |
| 35 // Glossy two-color bar with only light line at top (Mail.app/HitList-style) |
| 36 // Doesn't mesh with the matte look of the toolbar. |
| 37 |
| 38 NSRect topRect, bottomRect; |
| 39 NSDivideRect(rect, &topRect, &bottomRect, rect.size.height/2, NSMaxYEdge); |
| 40 |
| 41 // 1px line at top |
| 42 NSRect borderRect, contentRect; |
| 43 NSDivideRect(topRect, &borderRect, &contentRect, 1, NSMaxYEdge); |
| 44 [[NSColor colorWithDeviceWhite:0.69 alpha:1.0] set]; |
| 45 NSRectFillUsingOperation(borderRect, NSCompositeSourceOver); |
| 46 |
| 47 // Gradient for upper half |
| 48 NSColor* start = |
| 49 [NSColor colorWithCalibratedWhite: 1.0 alpha:1.0]; |
| 50 NSColor* end = [NSColor colorWithCalibratedWhite:0.94 alpha:1.0]; |
| 51 scoped_nsobject<NSGradient> gradient( |
| 52 [[NSGradient alloc] initWithStartingColor:start endingColor:end]); |
| 53 [gradient drawInRect:contentRect angle:270.0]; |
| 54 |
| 55 // Fill lower half with solid color |
| 56 [[NSColor colorWithDeviceWhite:0.9 alpha:1.0] set]; |
| 57 NSRectFillUsingOperation(bottomRect, NSCompositeSourceOver); |
| 58 #endif |
| 59 } |
| 60 |
| 61 @end |
| OLD | NEW |