Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3692)

Unified Diff: chrome/browser/cocoa/download_shelf_view.mm

Issue 93129: Initial download shelf on OS X.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: fix download_uitest Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/cocoa/download_shelf_view.h ('k') | chrome/browser/download/download_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/download_shelf_view.mm
===================================================================
--- chrome/browser/cocoa/download_shelf_view.mm (revision 0)
+++ chrome/browser/cocoa/download_shelf_view.mm (revision 0)
@@ -0,0 +1,61 @@
+// 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.
+
+#import "chrome/browser/cocoa/download_shelf_view.h"
+
+#include "base/scoped_nsobject.h"
+
+@implementation DownloadShelfView
+
+- (void)drawRect:(NSRect)rect {
+ rect = [self bounds];
+
+ // TODO(thakis): Once this has its final look, it also needs an
+ // "inactive" state.
+
+#if 0
+ // Grey Finder/iCal-like bottom bar with dark gradient, dark/light lines
+ NSColor* start =
+ [NSColor colorWithCalibratedWhite: 0.75 alpha:1.0];
+ NSColor* end = [NSColor colorWithCalibratedWhite:0.59 alpha:1.0];
+ scoped_nsobject<NSGradient> gradient(
+ [[NSGradient alloc] initWithStartingColor:start endingColor:end]);
+ [gradient drawInRect:[self bounds] angle:270.0];
+
+ NSRect borderRect, contentRect;
+ NSDivideRect(rect, &borderRect, &contentRect, 1, NSMaxYEdge);
+ [[NSColor colorWithDeviceWhite:0.25 alpha:1.0] set];
+ NSRectFillUsingOperation(borderRect, NSCompositeSourceOver);
+
+ NSDivideRect(contentRect, &borderRect, &contentRect, 1, NSMaxYEdge);
+ [[NSColor colorWithDeviceWhite:0.85 alpha:1.0] set];
+ NSRectFillUsingOperation(borderRect, NSCompositeSourceOver);
+#else
+ // Glossy two-color bar with only light line at top (Mail.app/HitList-style)
+ // Doesn't mesh with the matte look of the toolbar.
+
+ NSRect topRect, bottomRect;
+ NSDivideRect(rect, &topRect, &bottomRect, rect.size.height/2, NSMaxYEdge);
+
+ // 1px line at top
+ NSRect borderRect, contentRect;
+ NSDivideRect(topRect, &borderRect, &contentRect, 1, NSMaxYEdge);
+ [[NSColor colorWithDeviceWhite:0.69 alpha:1.0] set];
+ NSRectFillUsingOperation(borderRect, NSCompositeSourceOver);
+
+ // Gradient for upper half
+ NSColor* start =
+ [NSColor colorWithCalibratedWhite: 1.0 alpha:1.0];
+ NSColor* end = [NSColor colorWithCalibratedWhite:0.94 alpha:1.0];
+ scoped_nsobject<NSGradient> gradient(
+ [[NSGradient alloc] initWithStartingColor:start endingColor:end]);
+ [gradient drawInRect:contentRect angle:270.0];
+
+ // Fill lower half with solid color
+ [[NSColor colorWithDeviceWhite:0.9 alpha:1.0] set];
+ NSRectFillUsingOperation(bottomRect, NSCompositeSourceOver);
+#endif
+}
+
+@end
Property changes on: chrome/browser/cocoa/download_shelf_view.mm
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/cocoa/download_shelf_view.h ('k') | chrome/browser/download/download_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698