Commit b69d24c8 authored by Matthew Mourgos's avatar Matthew Mourgos Committed by Commit Bot

CrOS Shelf: Update position of notification app badge

This change updates the positioning and sizing of the notification app
badge to better match the spec.

Bug: 1080827
Change-Id: I9fcbde21694e6b054a71c4ef46aeb7b4d3282b61
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2351456Reviewed-by: default avatarToni Baržić <tbarzic@chromium.org>
Commit-Queue: Matthew Mourgos <mmourgos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#797587}
parent d82bb5b5
...@@ -48,7 +48,10 @@ constexpr int kStatusIndicatorMaxSize = 10; ...@@ -48,7 +48,10 @@ constexpr int kStatusIndicatorMaxSize = 10;
constexpr int kStatusIndicatorActiveSize = 8; constexpr int kStatusIndicatorActiveSize = 8;
constexpr int kStatusIndicatorRunningSize = 4; constexpr int kStatusIndicatorRunningSize = 4;
constexpr int kStatusIndicatorThickness = 2; constexpr int kStatusIndicatorThickness = 2;
constexpr int kNotificationIndicatorRadiusDip = 7;
constexpr int kNotificationIndicatorRadiusDip = 6;
constexpr int kNotificationIndicatorPadding = 1;
constexpr SkColor kDefaultIndicatorColor = SK_ColorWHITE; constexpr SkColor kDefaultIndicatorColor = SK_ColorWHITE;
// Slightly different colors and alpha in the new UI. // Slightly different colors and alpha in the new UI.
...@@ -743,10 +746,12 @@ void ShelfAppButton::Layout() { ...@@ -743,10 +746,12 @@ void ShelfAppButton::Layout() {
// The indicators should be aligned with the icon, not the icon + shadow. // The indicators should be aligned with the icon, not the icon + shadow.
gfx::Point indicator_midpoint = icon_view_bounds.CenterPoint(); gfx::Point indicator_midpoint = icon_view_bounds.CenterPoint();
if (is_notification_indicator_enabled_) { if (is_notification_indicator_enabled_) {
notification_indicator_->SetBoundsRect( notification_indicator_->SetBoundsRect(gfx::Rect(
gfx::Rect(icon_view_bounds.right() - kNotificationIndicatorRadiusDip, icon_view_bounds.right() - 2 * kNotificationIndicatorRadiusDip -
icon_view_bounds.y(), kNotificationIndicatorRadiusDip * 2, kNotificationIndicatorPadding,
kNotificationIndicatorRadiusDip * 2)); icon_view_bounds.y() + kNotificationIndicatorPadding,
kNotificationIndicatorRadiusDip * 2,
kNotificationIndicatorRadiusDip * 2));
} }
switch (shelf->alignment()) { switch (shelf->alignment()) {
......
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