diff options
author | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-03 18:57:02 +0000 |
---|---|---|
committer | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-03 18:57:02 +0000 |
commit | b105fb5ce39bac6f7515dee9b1373eb576d58c17 (patch) | |
tree | bf797c255dc8420ebf8093167d3c93c984be5fab /views | |
parent | fc1accc688f7cb6a35120640aa0e02a5c9055032 (diff) | |
download | chromium_src-b105fb5ce39bac6f7515dee9b1373eb576d58c17.zip chromium_src-b105fb5ce39bac6f7515dee9b1373eb576d58c17.tar.gz chromium_src-b105fb5ce39bac6f7515dee9b1373eb576d58c17.tar.bz2 |
Revert r17500
TBR=slightlyoff
BUG=none
TEST=none
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17508 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/controls/button/text_button.cc | 27 | ||||
-rw-r--r-- | views/controls/button/text_button.h | 12 |
2 files changed, 3 insertions, 36 deletions
diff --git a/views/controls/button/text_button.cc b/views/controls/button/text_button.cc index cc8eb08..e468e9e 100644 --- a/views/controls/button/text_button.cc +++ b/views/controls/button/text_button.cc @@ -156,9 +156,6 @@ TextButton::TextButton(ButtonListener* listener, const std::wstring& text) font_(ResourceBundle::GetSharedInstance().GetFont( ResourceBundle::BaseFont)), color_(kEnabledColor), - color_enabled_(kEnabledColor), - color_disabled_(kDisabledColor), - color_highlight_(kHighlightColor), max_width_(0) { SetText(text); set_border(new TextButtonBorder); @@ -181,20 +178,6 @@ void TextButton::SetIcon(const SkBitmap& icon) { icon_ = icon; } -void TextButton::SetEnabledColor(SkColor color) { - color_enabled_ = color; - UpdateColor(); -} - -void TextButton::SetDisabledColor(SkColor color) { - color_disabled_ = color; - UpdateColor(); -} - -void TextButton::SetHighlightColor(SkColor color) { - color_highlight_ = color; -} - void TextButton::ClearMaxTextSize() { max_text_size_ = text_size_; } @@ -262,7 +245,7 @@ void TextButton::Paint(gfx::Canvas* canvas, bool for_drag) { #if defined(OS_WIN) // TODO(erg): Either port DrawStringWithHalo to linux or find an // alternative here. - canvas->DrawStringWithHalo(text_, font_, color_, color_highlight_, + canvas->DrawStringWithHalo(text_, font_, color_, kHighlightColor, text_bounds.x(), text_bounds.y(), text_bounds.width(), @@ -273,7 +256,7 @@ void TextButton::Paint(gfx::Canvas* canvas, bool for_drag) { // Draw bevel highlight canvas->DrawStringInt(text_, font_, - color_highlight_, + kHighlightColor, text_bounds.x() + 1, text_bounds.y() + 1, text_bounds.width(), @@ -299,10 +282,6 @@ void TextButton::Paint(gfx::Canvas* canvas, bool for_drag) { } } -void TextButton::UpdateColor() { - color_ = IsEnabled() ? color_enabled_ : color_disabled_; -} - //////////////////////////////////////////////////////////////////////////////// // TextButton, View overrides: @@ -331,7 +310,7 @@ void TextButton::SetEnabled(bool enabled) { if (enabled == IsEnabled()) return; CustomButton::SetEnabled(enabled); - UpdateColor(); + color_ = enabled ? kEnabledColor : kDisabledColor; SchedulePaint(); } diff --git a/views/controls/button/text_button.h b/views/controls/button/text_button.h index e18ef59..1a8134e 100644 --- a/views/controls/button/text_button.h +++ b/views/controls/button/text_button.h @@ -89,9 +89,6 @@ class TextButton : public CustomButton { void ClearMaxTextSize(); void set_max_width(int max_width) { max_width_ = max_width; } - void SetEnabledColor(SkColor color); - void SetDisabledColor(SkColor color); - void SetHighlightColor(SkColor color); // Paint the button into the specified canvas. If |for_drag| is true, the // function paints a drag image representation into the canvas. @@ -106,10 +103,6 @@ class TextButton : public CustomButton { virtual bool OnMousePressed(const MouseEvent& e); virtual void Paint(gfx::Canvas* canvas); - // Called when enabled or disabled state changes, or the colors for those - // states change. - virtual void UpdateColor(); - private: // The text string that is displayed in the button. std::wstring text_; @@ -130,11 +123,6 @@ class TextButton : public CustomButton { // Text color. SkColor color_; - // State colors. - SkColor color_enabled_; - SkColor color_disabled_; - SkColor color_highlight_; - // An icon displayed with the text. SkBitmap icon_; |