Commit 4e88e35e authored by bartfab@chromium.org's avatar bartfab@chromium.org

LabelButton: Set the label's disabled status to match that of the button

The LabelButton hosts a Label to paints its text content. When the button
is disabled, that Label needs to be disabled as well so that it can paint
itself grayed out.

BUG=155363,162729


Review URL: https://chromiumcodereview.appspot.com/11411358

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171016 0039d316-1c4b-4281-b951-d872f2087c98
parent 0837d0c2
...@@ -153,6 +153,7 @@ void LabelButton::StateChanged() { ...@@ -153,6 +153,7 @@ void LabelButton::StateChanged() {
const SkColor color = button_state_colors_[state()]; const SkColor color = button_state_colors_[state()];
if (state() != STATE_DISABLED && label_->enabled_color() != color) if (state() != STATE_DISABLED && label_->enabled_color() != color)
label_->SetEnabledColor(color); label_->SetEnabledColor(color);
label_->SetEnabled(state() != STATE_DISABLED);
if (image_->GetPreferredSize() != previous_image_size) if (image_->GetPreferredSize() != previous_image_size)
Layout(); Layout();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment