Skip to content

Commit c4f321b

Browse files
author
Evan Stade
committed
Add a 1px border stroke to the shelf button active app indicator.
BUG=670970 Review-Url: https://codereview.chromium.org/2724403005 Cr-Commit-Position: refs/heads/master@{#454741} (cherry picked from commit 7367db2) Review-Url: https://codereview.chromium.org/2736973003 . Cr-Commit-Position: refs/branch-heads/3029@{#52} Cr-Branched-From: 939b32e-refs/heads/master@{#454471}
1 parent 651a2d0 commit c4f321b

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

ash/common/shelf/shelf_button.cc

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace {
3232
const int kIconSize = 32;
3333
const int kAttentionThrobDurationMS = 800;
3434
const int kMaxAnimationSeconds = 10;
35-
const int kIndicatorOffsetFromBottom = 2;
35+
const int kIndicatorOffsetFromBottom = 3;
3636
const int kIndicatorRadiusDip = 2;
3737
const SkColor kIndicatorColor = SK_ColorWHITE;
3838

@@ -146,11 +146,23 @@ class ShelfButton::AppStatusIndicatorView
146146

147147
DCHECK_EQ(width(), height());
148148
DCHECK_EQ(kIndicatorRadiusDip, width() / 2);
149+
const float dsf = canvas->UndoDeviceScaleFactor();
150+
const int kStrokeWidthPx = 1;
151+
gfx::PointF center = gfx::RectF(GetLocalBounds()).CenterPoint();
152+
center.Scale(dsf);
153+
154+
// Fill the center.
149155
cc::PaintFlags flags;
150156
flags.setColor(kIndicatorColor);
151157
flags.setFlags(cc::PaintFlags::kAntiAlias_Flag);
152-
canvas->DrawCircle(gfx::Point(width() / 2, height() / 2),
153-
kIndicatorRadiusDip, flags);
158+
canvas->DrawCircle(center, dsf * kIndicatorRadiusDip - kStrokeWidthPx,
159+
flags);
160+
161+
// Stroke the border.
162+
flags.setColor(SkColorSetA(SK_ColorBLACK, 0x4D));
163+
flags.setStyle(SkPaint::kStroke_Style);
164+
canvas->DrawCircle(
165+
center, dsf * kIndicatorRadiusDip - kStrokeWidthPx / 2.0f, flags);
154166
}
155167

156168
// ShelfButtonAnimation::Observer

0 commit comments

Comments
 (0)