diff options
author | gbillock@chromium.org <gbillock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-07 22:06:29 +0000 |
---|---|---|
committer | gbillock@chromium.org <gbillock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-01-07 22:06:29 +0000 |
commit | b518c3b8e5de9c94a254be5366e47edce72f0c51 (patch) | |
tree | e6656b0963eac915550f83186bb80cdbd19a84fe | |
parent | 5c4ad57dddfbba0001519b240b4f1fd72b8fe233 (diff) | |
download | chromium_src-b518c3b8e5de9c94a254be5366e47edce72f0c51.zip chromium_src-b518c3b8e5de9c94a254be5366e47edce72f0c51.tar.gz chromium_src-b518c3b8e5de9c94a254be5366e47edce72f0c51.tar.bz2 |
[Views] Only paint background of text portion of LabelButton in inverted color theme.
R=msw@chromium.org
BUG=330067
Review URL: https://codereview.chromium.org/120823003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243402 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | ui/views/controls/button/label_button.cc | 8 | ||||
-rw-r--r-- | ui/views/controls/button/label_button_border.cc | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/ui/views/controls/button/label_button.cc b/ui/views/controls/button/label_button.cc index 888a97c..3f5d563 100644 --- a/ui/views/controls/button/label_button.cc +++ b/ui/views/controls/button/label_button.cc @@ -8,9 +8,11 @@ #include "grit/ui_resources.h" #include "ui/base/resource/resource_bundle.h" #include "ui/gfx/animation/throb_animation.h" +#include "ui/gfx/canvas.h" #include "ui/gfx/font_list.h" #include "ui/gfx/sys_color_change_listener.h" #include "ui/native_theme/native_theme.h" +#include "ui/views/background.h" #include "ui/views/controls/button/label_button_border.h" #include "ui/views/painter.h" #include "ui/views/window/dialog_delegate.h" @@ -297,7 +299,7 @@ void LabelButton::GetExtraParams(ui::NativeTheme::ExtraParams* params) const { params->button.is_focused = HasFocus() && IsAccessibilityFocusable(); params->button.has_border = style() == STYLE_NATIVE_TEXTBUTTON; params->button.classic_state = 0; - params->button.background_color = label()->background_color(); + params->button.background_color = label_->background_color(); } void LabelButton::ResetColorsFromNativeTheme() { @@ -321,6 +323,7 @@ void LabelButton::ResetColorsFromNativeTheme() { constant_text_color = true; colors[STATE_NORMAL] = SK_ColorWHITE; label_->SetBackgroundColor(SK_ColorBLACK); + label_->set_background(Background::CreateSolidBackground(SK_ColorBLACK)); label_->SetAutoColorReadabilityEnabled(true); label_->ClearEmbellishing(); } else if (style() == STYLE_BUTTON) { @@ -328,9 +331,12 @@ void LabelButton::ResetColorsFromNativeTheme() { colors[STATE_NORMAL] = kStyleButtonTextColor; label_->SetBackgroundColor(theme->GetSystemColor( ui::NativeTheme::kColorId_ButtonBackgroundColor)); + label_->set_background(NULL); label_->SetAutoColorReadabilityEnabled(false); label_->SetShadowColors(kStyleButtonShadowColor, kStyleButtonShadowColor); label_->SetShadowOffset(0, 1); + } else { + label_->set_background(NULL); } if (constant_text_color) diff --git a/ui/views/controls/button/label_button_border.cc b/ui/views/controls/button/label_button_border.cc index d124764..5973a1a 100644 --- a/ui/views/controls/button/label_button_border.cc +++ b/ui/views/controls/button/label_button_border.cc @@ -142,12 +142,6 @@ void LabelButtonBorder::Paint(const View& view, gfx::Canvas* canvas) { } else { PaintHelper(this, canvas, theme, part, state, rect, extra); } - - // For inverted color schemes, draw a solid fill with the button color. - if (gfx::IsInvertedColorScheme()) { - rect.Inset(insets_); - canvas->FillRect(rect, extra.button.background_color); - } } gfx::Insets LabelButtonBorder::GetInsets() const { |