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

Side by Side Diff: chrome/browser/cocoa/gradient_button_cell.h

Issue 165499: Updates to clean up default theme and add hover states (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_COCOA_CHROMIUM_BUTTON_CELL_H_ 5 #ifndef CHROME_BROWSER_COCOA_CHROMIUM_BUTTON_CELL_H_
6 #define CHROME_BROWSER_COCOA_CHROMIUM_BUTTON_CELL_H_ 6 #define CHROME_BROWSER_COCOA_CHROMIUM_BUTTON_CELL_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 9
10 #include "base/scoped_nsobject.h" 10 #include "base/scoped_nsobject.h"
(...skipping 16 matching lines...) Expand all
27 }; 27 };
28 typedef NSInteger ButtonType; 28 typedef NSInteger ButtonType;
29 29
30 @interface GradientButtonCell : NSButtonCell { 30 @interface GradientButtonCell : NSButtonCell {
31 @private 31 @private
32 // Custom drawing means we need to perform our own mouse tracking if 32 // Custom drawing means we need to perform our own mouse tracking if
33 // the cell is setShowsBorderOnlyWhileMouseInside:YES. 33 // the cell is setShowsBorderOnlyWhileMouseInside:YES.
34 BOOL isMouseInside_; 34 BOOL isMouseInside_;
35 scoped_nsobject<NSTrackingArea> trackingArea_; 35 scoped_nsobject<NSTrackingArea> trackingArea_;
36 BOOL shouldTheme_; 36 BOOL shouldTheme_;
37 CGFloat hoverAlpha_; // 0-1. Controls the alpha during mouse hover
38 NSTimeInterval lastHoverUpdate_;
37 scoped_nsobject<NSGradient> gradient_; 39 scoped_nsobject<NSGradient> gradient_;
38 scoped_nsobject<NSImage> underlayImage_; 40 scoped_nsobject<NSImage> underlayImage_;
39 } 41 }
40 42
41 // Turn off theming. Temporary work-around. 43 // Turn off theming. Temporary work-around.
42 - (void)setShouldTheme:(BOOL)shouldTheme; 44 - (void)setShouldTheme:(BOOL)shouldTheme;
43 45
44 - (void)drawBorderAndFillForTheme:(GTMTheme*)theme 46 - (void)drawBorderAndFillForTheme:(GTMTheme*)theme
45 controlView:(NSView*)controlView 47 controlView:(NSView*)controlView
46 outerPath:(NSBezierPath*)outerPath 48 outerPath:(NSBezierPath*)outerPath
47 innerPath:(NSBezierPath*)innerPath 49 innerPath:(NSBezierPath*)innerPath
50 showClickedGradient:(BOOL)showClickedGradient
48 showHighlightGradient:(BOOL)showHighlightGradient 51 showHighlightGradient:(BOOL)showHighlightGradient
49 showClickedGradient:(BOOL)showClickedGradient 52 hoverAlpha:(CGFloat)hoverAlpha
50 active:(BOOL)active 53 active:(BOOL)active
51 cellFrame:(NSRect)cellFrame; 54 cellFrame:(NSRect)cellFrame;
52 55
53 // An image to underlay beneath the existing image; not themed. May be nil. 56 // An image to underlay beneath the existing image; not themed. May be nil.
54 - (NSImage*)underlayImage; 57 - (NSImage*)underlayImage;
55 - (void)setUnderlayImage:(NSImage*)image; 58 - (void)setUnderlayImage:(NSImage*)image;
56 59
60 // Let the view know when the mouse moves in and out. A timer will update
61 // the current hoverAlpha_ based on these events.
62 - (void)setMouseInside:(BOOL)flag animate:(BOOL)animate;
63
64 @property(assign, nonatomic)CGFloat hoverAlpha;
57 @end 65 @end
58 66
59 @interface GradientButtonCell(TestingAPI) 67 @interface GradientButtonCell(TestingAPI)
60 - (BOOL)isMouseInside; 68 - (BOOL)isMouseInside;
61 @end 69 @end
62 70
63 #endif // CHROME_BROWSER_COCOA_CHROMIUM_BUTTON_CELL_H_ 71 #endif // CHROME_BROWSER_COCOA_CHROMIUM_BUTTON_CELL_H_
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/download_item_cell.mm ('k') | chrome/browser/cocoa/gradient_button_cell.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698