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

Unified Diff: ui/chromeos/ime/candidate_view.cc

Issue 2910153002: Remove views::Label::SetDisabledColor(). Replace with typography colors. (Closed)
Patch Set: rebase for r476345 Created 3 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
Index: ui/chromeos/ime/candidate_view.cc
diff --git a/ui/chromeos/ime/candidate_view.cc b/ui/chromeos/ime/candidate_view.cc
index 0544fb7e3cbab30b6e6bb226a2e54785b7175beb..753cdc1812a4c3f51d54e2cd87b91554c3eabee1 100644
--- a/ui/chromeos/ime/candidate_view.cc
+++ b/ui/chromeos/ime/candidate_view.cc
@@ -53,6 +53,7 @@ views::Label* CreateShortcutLabel(
// |wrapped_shortcut_label| is deleted.
views::Label* shortcut_label = new views::Label;
+ // TODO(tapted): Get this FontList from views::style.
if (orientation == ui::CandidateWindow::VERTICAL) {
shortcut_label->SetFontList(shortcut_label->font_list().Derive(
kFontSizeDelta, gfx::Font::NORMAL, gfx::Font::Weight::BOLD));
@@ -62,10 +63,6 @@ views::Label* CreateShortcutLabel(
}
// TODO(satorux): Maybe we need to use language specific fonts for
// candidate_label, like Chinese font for Chinese input method?
- shortcut_label->SetEnabledColor(theme.GetSystemColor(
- ui::NativeTheme::kColorId_LabelEnabledColor));
- shortcut_label->SetDisabledColor(theme.GetSystemColor(
- ui::NativeTheme::kColorId_LabelDisabledColor));
// Setup paddings.
const gfx::Insets kVerticalShortcutLabelInsets(1, 6, 1, 6);
@@ -226,7 +223,10 @@ void CandidateView::SetHighlighted(bool highlighted) {
}
void CandidateView::StateChanged(ButtonState old_state) {
- shortcut_label_->SetEnabled(state() != STATE_DISABLED);
+ int text_style = state() == STATE_DISABLED ? views::style::STYLE_DISABLED
+ : views::style::STYLE_PRIMARY;
+ shortcut_label_->SetEnabledColor(views::style::GetColor(
+ views::style::CONTEXT_LABEL, text_style, GetNativeTheme()));
if (state() == STATE_PRESSED)
SetHighlighted(true);
}

Powered by Google App Engine
This is Rietveld 408576698