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

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

Issue 3058011: Add "pushed" as a state a TextButton can show (alongside "normal" and "hover"... (Closed) Base URL: svn://chrome-svn/chrome/trunk/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 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_;
« 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