Home | History | Annotate | Download | only in cocoa
      1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_UI_COCOA_VERTICAL_GRADIENT_VIEW_H_
      6 #define CHROME_BROWSER_UI_COCOA_VERTICAL_GRADIENT_VIEW_H_
      7 
      8 #include "base/mac/scoped_nsobject.h"
      9 
     10 #import <Cocoa/Cocoa.h>
     11 
     12 // Draws a vertical background gradient with a bottom stroke. The gradient and
     13 // stroke colors can be defined by calling |setGradient| and |setStrokeColor|,
     14 // respectively. Alternatively, you may override the |gradient| and
     15 // |strokeColor| accessors in order to provide colors dynamically. If the
     16 // gradient or color is |nil|, the respective element will not be drawn.
     17 @interface VerticalGradientView : NSView {
     18  @private
     19   // The gradient to draw.
     20   base::scoped_nsobject<NSGradient> gradient_;
     21   // Color for bottom stroke.
     22   base::scoped_nsobject<NSColor> strokeColor_;
     23 }
     24 
     25 // Gets and sets the gradient to paint as background.
     26 - (NSGradient*)gradient;
     27 - (void)setGradient:(NSGradient*)gradient;
     28 
     29 // Gets and sets the color of the stroke drawn at the bottom of the view.
     30 - (NSColor*)strokeColor;
     31 - (void)setStrokeColor:(NSColor*)gradient;
     32 
     33 @end
     34 
     35 #endif // CHROME_BROWSER_UI_COCOA_VERTICAL_GRADIENT_VIEW_H_
     36