| Index: ui/views/controls/label.cc
|
| diff --git a/ui/views/controls/label.cc b/ui/views/controls/label.cc
|
| index 77123bc4fb7102fd7d5f4a7f35d2e04cab3823f9..f92fda43e17896bb1d29286e9dd249b055eb256e 100644
|
| --- a/ui/views/controls/label.cc
|
| +++ b/ui/views/controls/label.cc
|
| @@ -333,7 +333,8 @@ bool Label::GetTooltipText(const gfx::Point& p, base::string16* tooltip) const {
|
| }
|
|
|
| void Label::OnEnabledChanged() {
|
| - RecalculateColors();
|
| + ApplyTextColors();
|
| + View::OnEnabledChanged();
|
| }
|
|
|
| std::unique_ptr<gfx::RenderText> Label::CreateRenderText(
|
| @@ -482,7 +483,7 @@ void Label::MaybeBuildRenderTextLines() {
|
| for (size_t i = lines_.size(); i < lines.size(); ++i)
|
| lines_.back()->SetText(lines_.back()->text() + lines[i]);
|
| }
|
| - RecalculateColors();
|
| + ApplyTextColors();
|
| }
|
|
|
| gfx::Rect Label::GetFocusBounds() {
|
| @@ -561,6 +562,11 @@ void Label::RecalculateColors() {
|
| background_color_) :
|
| requested_disabled_color_;
|
|
|
| + ApplyTextColors();
|
| + SchedulePaint();
|
| +}
|
| +
|
| +void Label::ApplyTextColors() {
|
| SkColor color = enabled() ? actual_enabled_color_ : actual_disabled_color_;
|
| bool subpixel_rendering_suppressed =
|
| SkColorGetA(background_color_) != 0xFF || !subpixel_rendering_enabled_;
|
| @@ -568,7 +574,6 @@ void Label::RecalculateColors() {
|
| lines_[i]->SetColor(color);
|
| lines_[i]->set_subpixel_rendering_suppressed(subpixel_rendering_suppressed);
|
| }
|
| - SchedulePaint();
|
| }
|
|
|
| void Label::UpdateColorsFromTheme(const ui::NativeTheme* theme) {
|
|
|