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

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

Issue 2625273002: Migrate more vector icons to chrome/. (Closed)
Patch Set: fix mac Created 3 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 | « ui/gfx/vector_icons/find_prev.1x.icon ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/vector_icon_button.cc
diff --git a/ui/views/controls/button/vector_icon_button.cc b/ui/views/controls/button/vector_icon_button.cc
index b3dbca975e4e8ed90c29dc93d6ece94d6a7ec8f6..848700a65ccfb3cc190bd7de7e2585dbad7751d5 100644
--- a/ui/views/controls/button/vector_icon_button.cc
+++ b/ui/views/controls/button/vector_icon_button.cc
@@ -52,14 +52,18 @@ void VectorIconButton::SetIcon(const gfx::VectorIcon& icon) {
void VectorIconButton::OnThemeChanged() {
SkColor icon_color =
color_utils::DeriveDefaultIconColor(delegate_->GetVectorIconBaseColor());
- gfx::ImageSkia image;
- if (icon_)
- image = gfx::CreateVectorIcon(*icon_, icon_color);
- else
- image = gfx::CreateVectorIcon(id_, icon_color);
- SetImage(views::CustomButton::STATE_NORMAL, &image);
- image = gfx::CreateVectorIcon(id_, SkColorSetA(icon_color, 0xff / 2));
- SetImage(views::CustomButton::STATE_DISABLED, &image);
+ SkColor disabled_color = SkColorSetA(icon_color, 0xff / 2);
+ if (icon_) {
+ SetImage(views::CustomButton::STATE_NORMAL,
+ gfx::CreateVectorIcon(*icon_, icon_color));
+ SetImage(views::CustomButton::STATE_DISABLED,
+ gfx::CreateVectorIcon(*icon_, disabled_color));
+ } else {
+ SetImage(views::CustomButton::STATE_NORMAL,
+ gfx::CreateVectorIcon(id_, icon_color));
+ SetImage(views::CustomButton::STATE_DISABLED,
+ gfx::CreateVectorIcon(id_, disabled_color));
+ }
set_ink_drop_base_color(icon_color);
}
« no previous file with comments | « ui/gfx/vector_icons/find_prev.1x.icon ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698