Commit 73e6ab95 authored by Tetsui Ohkubo's avatar Tetsui Ohkubo Committed by Commit Bot

Unified: Fix cellular network badge padding.

According to spec, network's tray icon size changed from 16dip to 20dip,
and we no longer have 2dip padding around network icons.

Also, because of that, new we can remove 1dip y-axis adjustment of
|top_left| badge e.g. "LTE" for cellular network.

For detail, see the screenshot in the bug.

TEST=manual
BUG=889589

Change-Id: Ib5eee3d05116e9deff936e6cb5287de9ac68a2de
Reviewed-on: https://chromium-review.googlesource.com/1250381Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595150}
parent 5caf3124
......@@ -5,6 +5,7 @@
#include "ash/public/cpp/network_icon_image_source.h"
#include "ash/public/cpp/ash_constants.h"
#include "ash/public/cpp/ash_features.h"
#include "third_party/skia/include/core/SkPath.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/geometry/insets.h"
......@@ -75,7 +76,8 @@ void NetworkIconImageSource::Draw(gfx::Canvas* canvas) {
// The other badges are flush against the edges of the canvas, except at the
// top, where the badge is only 1dp higher than the base image.
const int top_badge_y = icon_y - 1;
const int top_badge_y =
features::IsSystemTrayUnifiedEnabled() ? icon_y : icon_y - 1;
if (badges_.top_left.icon)
paint_badge(badges_.top_left, 0, top_badge_y);
if (badges_.bottom_left.icon) {
......
......@@ -194,6 +194,8 @@ bool IconTypeHasVPNBadge(IconType icon_type) {
}
gfx::Size GetSizeForBaseIconSize(const gfx::Size& base_icon_size) {
if (features::IsSystemTrayUnifiedEnabled())
return base_icon_size;
gfx::Size size = base_icon_size;
const int badge_offset = base_icon_size.width() == kTrayIconSize
? kTrayIconBadgeOffset
......
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