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

Unified Diff: ui/views/controls/button/image_button.cc

Issue 1641993002: Repaint ImageButton when image is changed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/image_button.cc
diff --git a/ui/views/controls/button/image_button.cc b/ui/views/controls/button/image_button.cc
index e9d4f36c92bee7283cc41fba93c008757c0aa014..fdaa27530d547647f5e46810d45a55aaa70ea86b 100644
--- a/ui/views/controls/button/image_button.cc
+++ b/ui/views/controls/button/image_button.cc
@@ -47,9 +47,11 @@ const gfx::ImageSkia& ImageButton::GetImage(ButtonState state) const {
return images_[state];
}
-void ImageButton::SetImage(ButtonState state, const gfx::ImageSkia* image) {
- images_[state] = image ? *image : gfx::ImageSkia();
+void ImageButton::SetImage(ButtonState for_state, const gfx::ImageSkia* image) {
+ images_[for_state] = image ? *image : gfx::ImageSkia();
PreferredSizeChanged();
+ if (state() == for_state)
+ SchedulePaint();
}
void ImageButton::SetBackground(SkColor color,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698