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

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

Issue 1958453002: Update some secondary UI buttons to MD style. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: msw review Created 4 years, 7 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/md_text_button.cc
diff --git a/ui/views/controls/button/md_text_button.cc b/ui/views/controls/button/md_text_button.cc
index 4f38188c47a507db70b468b8e0a818b6e9966021..1036a2addf0ee7acf71f08671d10fccae9d46e37 100644
--- a/ui/views/controls/button/md_text_button.cc
+++ b/ui/views/controls/button/md_text_button.cc
@@ -113,7 +113,11 @@ void MdTextButton::UpdateColorsFromNativeTheme() {
ui::NativeTheme::ColorId fg_color_id = ui::NativeTheme::kColorId_NumColors;
switch (cta_) {
case NO_CALL_TO_ACTION:
- fg_color_id = ui::NativeTheme::kColorId_ButtonEnabledColor;
+ // When there's no call to action, respect a color override if one has
+ // been set. For other call to action states, don't let individual buttons
+ // specify a color.
+ if (!explicitly_set_normal_color())
+ fg_color_id = ui::NativeTheme::kColorId_ButtonEnabledColor;
break;
case WEAK_CALL_TO_ACTION:
fg_color_id = ui::NativeTheme::kColorId_CallToActionColor;
@@ -123,7 +127,8 @@ void MdTextButton::UpdateColorsFromNativeTheme() {
break;
}
ui::NativeTheme* theme = GetNativeTheme();
- SetEnabledTextColors(theme->GetSystemColor(fg_color_id));
+ if (fg_color_id != ui::NativeTheme::kColorId_NumColors)
+ SetEnabledTextColors(theme->GetSystemColor(fg_color_id));
set_background(
cta_ == STRONG_CALL_TO_ACTION
« 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