Commit 6d865d24 authored by estade's avatar estade Committed by Commit bot

Repaint ImageButton when image is changed.

This matches behavior of ImageView::SetImage.

BUG=581965

Review URL: https://codereview.chromium.org/1641993002

Cr-Commit-Position: refs/heads/master@{#372031}
parent 82a9e031
...@@ -47,9 +47,11 @@ const gfx::ImageSkia& ImageButton::GetImage(ButtonState state) const { ...@@ -47,9 +47,11 @@ const gfx::ImageSkia& ImageButton::GetImage(ButtonState state) const {
return images_[state]; return images_[state];
} }
void ImageButton::SetImage(ButtonState state, const gfx::ImageSkia* image) { void ImageButton::SetImage(ButtonState for_state, const gfx::ImageSkia* image) {
images_[state] = image ? *image : gfx::ImageSkia(); images_[for_state] = image ? *image : gfx::ImageSkia();
PreferredSizeChanged(); PreferredSizeChanged();
if (state() == for_state)
SchedulePaint();
} }
void ImageButton::SetBackground(SkColor color, void ImageButton::SetBackground(SkColor color,
......
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