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

Unified Diff: views/controls/button/text_button.h

Issue 3075017: Merge 53847 - Add "pushed" as a state a TextButton can show (alongside "norma... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/472/src/
Patch Set: Created 10 years, 5 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/views/wrench_menu.cc ('k') | views/controls/button/text_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/button/text_button.h
===================================================================
--- views/controls/button/text_button.h (revision 54669)
+++ views/controls/button/text_button.h (working copy)
@@ -105,10 +105,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,
@@ -132,8 +133,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 for the button icon
+ // (if present) in addition to the normal state. Defaults to true.
+ void SetShowMultipleIconStates(bool show_multiple_icon_states);
// Paint the button into the specified canvas. If |for_drag| is true, the
// function paints a drag image representation into the canvas.
@@ -151,6 +153,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
@@ -197,6 +201,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_;
@@ -204,8 +212,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 icon states.
+ bool show_multiple_icon_states_;
PrefixType prefix_type_;
« no previous file with comments | « chrome/browser/views/wrench_menu.cc ('k') | views/controls/button/text_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698