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

Unified Diff: ui/views/controls/button/label_button.cc

Issue 23534062: Fix Views blue button's blurry text on Aura. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make LabelButton::ResetColorsFromNativeTheme virtual; override for BlueButton. Created 7 years, 3 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 | « ui/views/controls/button/label_button.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/label_button.cc
diff --git a/ui/views/controls/button/label_button.cc b/ui/views/controls/button/label_button.cc
index 901dbf4063f64c37de117ba5ec34ca68597219ba..ae4ffe05311dc2795415d21bba145d0f5b13575b 100644
--- a/ui/views/controls/button/label_button.cc
+++ b/ui/views/controls/button/label_button.cc
@@ -257,10 +257,6 @@ void LabelButton::GetExtraParams(ui::NativeTheme::ExtraParams* params) const {
params->button.background_color = label()->background_color();
}
-void LabelButton::UpdateImage() {
- image_->SetImage(GetImage(state()));
-}
-
void LabelButton::ResetColorsFromNativeTheme() {
const ui::NativeTheme* theme = GetNativeTheme();
SkColor colors[STATE_COUNT] = {
@@ -277,9 +273,6 @@ void LabelButton::ResetColorsFromNativeTheme() {
theme == ui::NativeThemeWin::instance());
#endif
- label_->SetBackgroundColor(theme->GetSystemColor(
- ui::NativeTheme::kColorId_ButtonBackgroundColor));
-
// Use hardcoded colors for inverted color scheme support and STYLE_BUTTON.
if (gfx::IsInvertedColorScheme()) {
constant_text_color = true;
@@ -290,6 +283,8 @@ void LabelButton::ResetColorsFromNativeTheme() {
} else if (style() == STYLE_BUTTON) {
constant_text_color = true;
colors[STATE_NORMAL] = kStyleButtonTextColor;
+ label_->SetBackgroundColor(theme->GetSystemColor(
+ ui::NativeTheme::kColorId_ButtonBackgroundColor));
label_->SetAutoColorReadabilityEnabled(false);
label_->SetShadowColors(kStyleButtonShadowColor, kStyleButtonShadowColor);
label_->SetShadowOffset(0, 1);
@@ -306,6 +301,10 @@ void LabelButton::ResetColorsFromNativeTheme() {
}
}
+void LabelButton::UpdateImage() {
+ image_->SetImage(GetImage(state()));
+}
+
void LabelButton::StateChanged() {
const gfx::Size previous_image_size(image_->GetPreferredSize());
UpdateImage();
« no previous file with comments | « ui/views/controls/button/label_button.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698