Commit b9b7d588 authored by Thomas Tangl's avatar Thomas Tangl Committed by Commit Bot

[profile-menu] Use circle sync icons

... and use bubble background for sync badge background.

Bug: 995720
Change-Id: Id9f0d68eb1695c2b74fc41a6a888d9db38e413d5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1872213
Commit-Queue: Thomas Tangl <tangltom@chromium.org>
Commit-Queue: Marc Treib <treib@chromium.org>
Auto-Submit: Thomas Tangl <tangltom@chromium.org>
Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#707829}
parent b528279c
......@@ -460,7 +460,7 @@ gfx::ImageSkia ProfileMenuView::GetSyncIcon() {
return gfx::ImageSkia();
if (!identity_manager->HasPrimaryAccount())
return ColoredImageForMenu(kSyncPausedIcon, gfx::kGoogleGrey500);
return ColoredImageForMenu(kSyncPausedCircleIcon, gfx::kGoogleGrey500);
const gfx::VectorIcon* icon = nullptr;
ui::NativeTheme::ColorId color_id;
......@@ -468,11 +468,11 @@ gfx::ImageSkia ProfileMenuView::GetSyncIcon() {
switch (
sync_ui_util::GetMessagesForAvatarSyncError(profile, &unused, &unused)) {
case sync_ui_util::NO_SYNC_ERROR:
icon = &kSyncIcon;
icon = &kSyncCircleIcon;
color_id = ui::NativeTheme::kColorId_AlertSeverityLow;
break;
case sync_ui_util::AUTH_ERROR:
icon = &kSyncPausedIcon;
icon = &kSyncPausedCircleIcon;
color_id = ui::NativeTheme::kColorId_ProminentButtonColor;
break;
case sync_ui_util::MANAGED_USER_UNRECOVERABLE_ERROR:
......@@ -480,7 +480,7 @@ gfx::ImageSkia ProfileMenuView::GetSyncIcon() {
case sync_ui_util::UPGRADE_CLIENT_ERROR:
case sync_ui_util::PASSPHRASE_ERROR:
case sync_ui_util::SETTINGS_UNCONFIRMED_ERROR:
icon = &kSyncPausedIcon;
icon = &kSyncPausedCircleIcon;
color_id = ui::NativeTheme::kColorId_AlertSeverityHigh;
break;
}
......
......@@ -282,6 +282,8 @@ void ProfileMenuViewBase::SetIdentityInfo(const gfx::ImageSkia& image,
constexpr int kImageBottomMargin = 8;
constexpr int kBadgeSize = 16;
constexpr int kBadgePadding = 1;
const SkColor kBadgeBackgroundColor = GetNativeTheme()->GetSystemColor(
ui::NativeTheme::kColorId_BubbleBackground);
identity_info_container_->RemoveAllChildViews(/*delete_children=*/true);
identity_info_container_->SetLayoutManager(
......@@ -300,7 +302,7 @@ void ProfileMenuViewBase::SetIdentityInfo(const gfx::ImageSkia& image,
GetDefaultIconColor())
: CropCircle(SizeImage(image, kIdentityImageSize));
gfx::ImageSkia sized_badge =
AddCircularBackground(SizeImage(badge, kBadgeSize), SK_ColorWHITE,
AddCircularBackground(SizeImage(badge, kBadgeSize), kBadgeBackgroundColor,
kBadgeSize + 2 * kBadgePadding);
gfx::ImageSkia badged_image =
gfx::ImageSkiaOperations::CreateIconWithBadge(sized_image, sized_badge);
......
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