Commit 35957a1b authored by Ahmed Mehfooz's avatar Ahmed Mehfooz Committed by Commit Bot

Fix disabled icon colors for system tray

We need to use opaque colors to make sure the
stroke on the outside of the icon doesn't look
like it's overlapping with the background color.

Bug: 1117581
Change-Id: Id33595d5250327cf07c97f4b737fec7d6785e6e9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2533846
Commit-Queue: Ahmed Mehfooz <amehfooz@chromium.org>
Reviewed-by: default avatarMin Chen <minch@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#827396}
parent be191383
......@@ -339,7 +339,7 @@ void AshColorProvider::DecorateIconButton(views::ImageButton* button,
button->SetImage(views::Button::STATE_NORMAL, new_normal_image);
button->SetImage(
views::Button::STATE_DISABLED,
gfx::CreateVectorIcon(icon, icon_size, GetDisabledColor(icon_color)));
gfx::CreateVectorIcon(icon, icon_size, GetDisabledColor(normal_color)));
}
void AshColorProvider::AddObserver(ColorModeObserver* observer) {
......
......@@ -433,20 +433,23 @@ NetworkIconImpl* FindAndUpdateImageImpl(const NetworkStateProperties* network,
// Public interface
SkColor GetDefaultColorForIconType(IconType icon_type) {
auto* ash_color_provider = AshColorProvider::Get();
switch (icon_type) {
case ICON_TYPE_TRAY_OOBE:
return kIconColorInOobe;
case ICON_TYPE_FEATURE_POD:
return AshColorProvider::Get()->GetContentLayerColor(
return ash_color_provider->GetContentLayerColor(
AshColorProvider::ContentLayerType::kButtonIconColor);
case ICON_TYPE_FEATURE_POD_TOGGLED:
return AshColorProvider::Get()->GetContentLayerColor(
return ash_color_provider->GetContentLayerColor(
AshColorProvider::ContentLayerType::kButtonIconColorPrimary);
case ICON_TYPE_FEATURE_POD_DISABLED:
return AshColorProvider::GetDisabledColor(
GetDefaultColorForIconType(ICON_TYPE_FEATURE_POD));
return color_utils::GetResultingPaintColor(
AshColorProvider::GetDisabledColor(
GetDefaultColorForIconType(ICON_TYPE_FEATURE_POD)),
ash_color_provider->GetBackgroundColor());
default:
return AshColorProvider::Get()->GetContentLayerColor(
return ash_color_provider->GetContentLayerColor(
AshColorProvider::ContentLayerType::kIconColorPrimary);
}
}
......
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