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

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

Issue 11558006: Fix label color in TextButtonBase (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/text_button.cc
===================================================================
--- ui/views/controls/button/text_button.cc (revision 172348)
+++ ui/views/controls/button/text_button.cc (working copy)
@@ -207,21 +207,17 @@
show_multiple_icon_states_(true),
is_default_(false),
multi_line_(false),
- color_(ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_TextButtonEnabledColor)),
- color_enabled_(ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_TextButtonEnabledColor)),
- color_disabled_(ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_TextButtonDisabledColor)),
- color_highlight_(ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_TextButtonHighlightColor)),
- color_hover_(ui::NativeTheme::instance()->GetSystemColor(
- ui::NativeTheme::kColorId_TextButtonHoverColor)),
+ color_(0),
msw 2012/12/12 19:38:16 nit: Skip initializing these values to 0.
cpu_(ooo_6.6-7.5) 2012/12/12 22:53:25 Done.
+ color_enabled_(0),
+ color_disabled_(0),
+ color_highlight_(0),
+ color_hover_(0),
use_enabled_color_from_theme_(true),
use_disabled_color_from_theme_(true),
use_highlight_color_from_theme_(true),
use_hover_color_from_theme_(true) {
SetText(text);
+ OnNativeThemeChanged(ui::NativeTheme::instance());
SetAnimationDuration(kHoverAnimationDurationMs);
}
@@ -534,11 +530,11 @@
void TextButtonBase::OnNativeThemeChanged(const ui::NativeTheme* theme) {
if (use_enabled_color_from_theme_) {
color_enabled_ = theme->GetSystemColor(
- ui::NativeTheme::kColorId_TextButtonEnabledColor);
+ ui::NativeTheme::kColorId_LabelEnabledColor);
msw 2012/12/12 19:38:16 Repurpose kColorId_TextButtonEnabledColor to get C
cpu_(ooo_6.6-7.5) 2012/12/12 22:53:25 Done.
}
if (use_disabled_color_from_theme_) {
color_disabled_ = theme->GetSystemColor(
- ui::NativeTheme::kColorId_TextButtonDisabledColor);
+ ui::NativeTheme::kColorId_LabelDisabledColor);
msw 2012/12/12 19:38:16 Using kColorId_LabelDisabledColor (COLOR_GRAYTEXT)
cpu_(ooo_6.6-7.5) 2012/12/12 22:53:25 Done.
}
if (use_highlight_color_from_theme_) {
color_highlight_ = theme->GetSystemColor(
cpu_(ooo_6.6-7.5) 2012/12/12 03:42:12 highlight_ is only used on windows and only in PB_
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698