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

Side by Side Diff: ui/views/controls/button/label_button.cc

Issue 2910153002: Remove views::Label::SetDisabledColor(). Replace with typography colors. (Closed)
Patch Set: rebase for r476345 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/controls/button/label_button.h" 5 #include "ui/views/controls/button/label_button.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 return label_->text(); 92 return label_->text();
93 } 93 }
94 94
95 void LabelButton::SetText(const base::string16& text) { 95 void LabelButton::SetText(const base::string16& text) {
96 SetTextInternal(text); 96 SetTextInternal(text);
97 } 97 }
98 98
99 void LabelButton::SetTextColor(ButtonState for_state, SkColor color) { 99 void LabelButton::SetTextColor(ButtonState for_state, SkColor color) {
100 button_state_colors_[for_state] = color; 100 button_state_colors_[for_state] = color;
101 if (for_state == STATE_DISABLED) 101 if (for_state == STATE_DISABLED)
102 label_->SetDisabledColor(color); 102 label_->SetDisabledColorForLabelButton(color);
103 else if (for_state == state()) 103 else if (for_state == state())
104 label_->SetEnabledColor(color); 104 label_->SetEnabledColor(color);
105 explicitly_set_colors_[for_state] = true; 105 explicitly_set_colors_[for_state] = true;
106 } 106 }
107 107
108 void LabelButton::SetEnabledTextColors(SkColor color) { 108 void LabelButton::SetEnabledTextColors(SkColor color) {
109 ButtonState states[] = {STATE_NORMAL, STATE_HOVERED, STATE_PRESSED}; 109 ButtonState states[] = {STATE_NORMAL, STATE_HOVERED, STATE_PRESSED};
110 for (auto state : states) 110 for (auto state : states)
111 SetTextColor(state, color); 111 SetTextColor(state, color);
112 } 112 }
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 void LabelButton::ResetLabelEnabledColor() { 544 void LabelButton::ResetLabelEnabledColor() {
545 const SkColor color = 545 const SkColor color =
546 explicitly_set_colors_[state()] 546 explicitly_set_colors_[state()]
547 ? button_state_colors_[state()] 547 ? button_state_colors_[state()]
548 : PlatformStyle::TextColorForButton(button_state_colors_, *this); 548 : PlatformStyle::TextColorForButton(button_state_colors_, *this);
549 if (state() != STATE_DISABLED && label_->enabled_color() != color) 549 if (state() != STATE_DISABLED && label_->enabled_color() != color)
550 label_->SetEnabledColor(color); 550 label_->SetEnabledColor(color);
551 } 551 }
552 552
553 } // namespace views 553 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698