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

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

Issue 2957263002: Update dialog button text color for Harmony per the latest button spec (Closed)
Patch Set: color_utils::IsInvertedColorScheme(), fewer Win constants Created 3 years, 6 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 | « chrome/browser/ui/views/harmony/harmony_typography_provider.cc ('k') | ui/views/controls/label.h » ('j') | 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 43c0b48be5ab7345b338ce94d0e3327d70b34280..8aa0a62e8a29f817ffdba8a596256c4c59273105 100644
--- a/ui/views/controls/button/md_text_button.cc
+++ b/ui/views/controls/button/md_text_button.cc
@@ -238,21 +238,21 @@ void MdTextButton::UpdatePadding() {
}
void MdTextButton::UpdateColors() {
- ui::NativeTheme::ColorId fg_color_id =
- is_prominent_ ? ui::NativeTheme::kColorId_TextOnProminentButtonColor
- : ui::NativeTheme::kColorId_ButtonEnabledColor;
-
ui::NativeTheme* theme = GetNativeTheme();
+ SkColor enabled_text_color = style::GetColor(
+ label()->text_context(),
+ is_prominent_ ? style::STYLE_DIALOG_BUTTON_DEFAULT : style::STYLE_PRIMARY,
+ theme);
if (!explicitly_set_normal_color()) {
const auto colors = explicitly_set_colors();
- LabelButton::SetEnabledTextColors(theme->GetSystemColor(fg_color_id));
+ LabelButton::SetEnabledTextColors(enabled_text_color);
set_explicitly_set_colors(colors);
}
// Prominent buttons keep their enabled text color; disabled state is conveyed
// by shading the background instead.
if (is_prominent_)
- SetTextColor(STATE_DISABLED, theme->GetSystemColor(fg_color_id));
+ SetTextColor(STATE_DISABLED, enabled_text_color);
SkColor text_color = label()->enabled_color();
SkColor bg_color =
« no previous file with comments | « chrome/browser/ui/views/harmony/harmony_typography_provider.cc ('k') | ui/views/controls/label.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698