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

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

Issue 2240603002: Harmony checkbox/radio tweaks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tests Created 4 years, 4 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/checkbox.cc ('k') | ui/views/controls/button/label_button_unittest.cc » ('j') | 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 9812efc27c6bae3e391017b191952e838485c7b5..face3975a2e5901512cbb2fb853e2e128b93b81f 100644
--- a/ui/views/controls/button/label_button.cc
+++ b/ui/views/controls/button/label_button.cc
@@ -485,11 +485,24 @@ void LabelButton::GetExtraParams(ui::NativeTheme::ExtraParams* params) const {
void LabelButton::ResetColorsFromNativeTheme() {
const ui::NativeTheme* theme = GetNativeTheme();
+ bool button_style = style() == STYLE_BUTTON;
+ // Button colors are used only for STYLE_BUTTON, otherwise we use label
+ // colors. As it turns out, these are almost always the same color anyway in
+ // pre-MD, although in the MD world labels and buttons get different colors.
+ // TODO(estade): simplify this by removing STYLE_BUTTON.
SkColor colors[STATE_COUNT] = {
- theme->GetSystemColor(ui::NativeTheme::kColorId_ButtonEnabledColor),
- theme->GetSystemColor(ui::NativeTheme::kColorId_ButtonHoverColor),
- theme->GetSystemColor(ui::NativeTheme::kColorId_ButtonHoverColor),
- theme->GetSystemColor(ui::NativeTheme::kColorId_ButtonDisabledColor),
+ theme->GetSystemColor(button_style
+ ? ui::NativeTheme::kColorId_ButtonEnabledColor
+ : ui::NativeTheme::kColorId_LabelEnabledColor),
+ theme->GetSystemColor(button_style
+ ? ui::NativeTheme::kColorId_ButtonHoverColor
+ : ui::NativeTheme::kColorId_LabelEnabledColor),
+ theme->GetSystemColor(button_style
+ ? ui::NativeTheme::kColorId_ButtonHoverColor
+ : ui::NativeTheme::kColorId_LabelEnabledColor),
+ theme->GetSystemColor(button_style
+ ? ui::NativeTheme::kColorId_ButtonDisabledColor
+ : ui::NativeTheme::kColorId_LabelDisabledColor),
};
// Use hardcoded colors for inverted color scheme support and STYLE_BUTTON.
« no previous file with comments | « ui/views/controls/button/checkbox.cc ('k') | ui/views/controls/button/label_button_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698