| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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_UI_COCOA_GRADIENT_BUTTON_CELL_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_GRADIENT_BUTTON_CELL_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_GRADIENT_BUTTON_CELL_H_ | 6 #define CHROME_BROWSER_UI_COCOA_GRADIENT_BUTTON_CELL_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/mac/scoped_nsobject.h" | 10 #include "base/mac/scoped_nsobject.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 kLeftButtonType = -1, | 24 kLeftButtonType = -1, |
| 25 kLeftButtonWithShadowType = -2, | 25 kLeftButtonWithShadowType = -2, |
| 26 kStandardButtonType = 0, | 26 kStandardButtonType = 0, |
| 27 kRightButtonType = 1, | 27 kRightButtonType = 1, |
| 28 kMiddleButtonType = 2, | 28 kMiddleButtonType = 2, |
| 29 // Draws like a standard button, except when clicked where the interior | 29 // Draws like a standard button, except when clicked where the interior |
| 30 // doesn't darken using the theme's "pressed" gradient. Instead uses the | 30 // doesn't darken using the theme's "pressed" gradient. Instead uses the |
| 31 // normal un-pressed gradient. | 31 // normal un-pressed gradient. |
| 32 kStandardButtonTypeWithLimitedClickFeedback = 3, | 32 kStandardButtonTypeWithLimitedClickFeedback = 3, |
| 33 kMaterialStandardButtonTypeWithLimitedClickFeedback = 4, | 33 kMaterialStandardButtonTypeWithLimitedClickFeedback = 4, |
| 34 kMaterialMenuButtonTypeWithLimitedClickFeedback = 5, |
| 34 }; | 35 }; |
| 35 typedef NSInteger ButtonType; | 36 typedef NSInteger ButtonType; |
| 36 | 37 |
| 37 namespace gradient_button_cell { | 38 namespace gradient_button_cell { |
| 38 | 39 |
| 39 // Pulsing state for this button. | 40 // Pulsing state for this button. |
| 40 typedef enum { | 41 typedef enum { |
| 41 // Stable states. | 42 // Stable states. |
| 42 kPulsedOn, | 43 kPulsedOn, |
| 43 kPulsedOff, | 44 kPulsedOff, |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 - (CGFloat)textStartXOffset; | 112 - (CGFloat)textStartXOffset; |
| 112 | 113 |
| 113 // Defines the top offset of text within the cell. Used by drawTitle and can | 114 // Defines the top offset of text within the cell. Used by drawTitle and can |
| 114 // be overriden by objects that inherit this class for placement of text. | 115 // be overriden by objects that inherit this class for placement of text. |
| 115 - (int)verticalTextOffset; | 116 - (int)verticalTextOffset; |
| 116 | 117 |
| 117 // The amount by which the gradient button cell should nudge the path used to | 118 // The amount by which the gradient button cell should nudge the path used to |
| 118 // draw the hover (and pressed) state background path. | 119 // draw the hover (and pressed) state background path. |
| 119 - (CGFloat)hoverBackgroundVerticalOffsetInControlView:(NSView*)controlView; | 120 - (CGFloat)hoverBackgroundVerticalOffsetInControlView:(NSView*)controlView; |
| 120 | 121 |
| 122 // Returns YES if the cell's tag indicates a Material Design button type. |
| 123 - (BOOL)isMaterialDesignButtonType; |
| 124 |
| 121 @property(assign, nonatomic) CGFloat hoverAlpha; | 125 @property(assign, nonatomic) CGFloat hoverAlpha; |
| 122 | 126 |
| 123 // An image that will be drawn after the normal content of the button cell, | 127 // An image that will be drawn after the normal content of the button cell, |
| 124 // overlaying it. Never themed. | 128 // overlaying it. Never themed. |
| 125 @property(retain, nonatomic) NSImage* overlayImage; | 129 @property(retain, nonatomic) NSImage* overlayImage; |
| 126 | 130 |
| 127 @end | 131 @end |
| 128 | 132 |
| 129 @interface GradientButtonCell(TestingAPI) | 133 @interface GradientButtonCell(TestingAPI) |
| 130 - (BOOL)isMouseInside; | 134 - (BOOL)isMouseInside; |
| 131 - (BOOL)pulsing; | 135 - (BOOL)pulsing; |
| 132 - (gradient_button_cell::PulseState)pulseState; | 136 - (gradient_button_cell::PulseState)pulseState; |
| 133 - (void)setPulseState:(gradient_button_cell::PulseState)pstate; | 137 - (void)setPulseState:(gradient_button_cell::PulseState)pstate; |
| 134 @end | 138 @end |
| 135 | 139 |
| 136 #endif // CHROME_BROWSER_UI_COCOA_GRADIENT_BUTTON_CELL_H_ | 140 #endif // CHROME_BROWSER_UI_COCOA_GRADIENT_BUTTON_CELL_H_ |
| OLD | NEW |