Chromium Code Reviews| Index: views/controls/button/text_button.h |
| =================================================================== |
| --- views/controls/button/text_button.h (revision 53742) |
| +++ views/controls/button/text_button.h (working copy) |
| @@ -106,10 +106,11 @@ |
| // Sets the icon. |
| void SetIcon(const SkBitmap& icon); |
| - SkBitmap icon() const { return icon_; } |
| void SetHoverIcon(const SkBitmap& icon); |
| - SkBitmap icon_hover() const { return icon_hover_; } |
| + void SetPushedIcon(const SkBitmap& icon); |
| + bool HasIcon() const { return !icon_.empty(); } |
| + |
| // Meanings are reversed for right-to-left layouts. |
| enum IconPlacement { |
| ICON_ON_LEFT, |
| @@ -133,8 +134,9 @@ |
| void SetHighlightColor(SkColor color); |
| void SetHoverColor(SkColor color); |
| void SetNormalHasBorder(bool normal_has_border); |
| - // Sets whether or not to show the highlighed (i.e. hot) state. Default true. |
| - void SetShowHighlighted(bool show_highlighted); |
| + // Sets whether or not to show the hot and pushed states in addition to the |
| + // normal state. Defaults to true. |
| + void SetShowMultipleStates(bool show_multiple_states); |
|
Ben Goodger (Google)
2010/07/27 21:20:09
I think this should be SetShowMultipleIconStates t
|
| // Paint the button into the specified canvas. If |for_drag| is true, the |
| // function paints a drag image representation into the canvas. |
| @@ -152,6 +154,8 @@ |
| static const SkColor kHoverColor; |
| protected: |
| + SkBitmap icon() const { return icon_; } |
| + |
| virtual void Paint(gfx::Canvas* canvas); |
| // Called when enabled or disabled state changes, or the colors for those |
| @@ -198,6 +202,10 @@ |
| SkBitmap icon_hover_; |
| bool has_hover_icon_; |
| + // An optional different version of the icon for pushed state. |
| + SkBitmap icon_pushed_; |
| + bool has_pushed_icon_; |
| + |
| // The width of the button will never be larger than this value. A value <= 0 |
| // indicates the width is not constrained. |
| int max_width_; |
| @@ -205,8 +213,8 @@ |
| // This is true if normal state has a border frame; default is false. |
| bool normal_has_border_; |
| - // Whether or not to show the highlighted (i.e. hot) state. |
| - bool show_highlighted_; |
| + // Whether or not to show the hot and pushed states. |
| + bool show_multiple_states_; |
| PrefixType prefix_type_; |