Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1351)

Unified Diff: ash/common/shelf/shelf_button.cc

Issue 2724403005: Add a 1px border stroke to the shelf button active app indicator. (Closed)
Patch Set: adjust color and position Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/shelf/shelf_button.cc
diff --git a/ash/common/shelf/shelf_button.cc b/ash/common/shelf/shelf_button.cc
index b39fa9c2f785d3bd2c4c23ae58b1dd20de0d3ccc..d5d32ff71833d2f7f240a64f9a353a5e7ff079d6 100644
--- a/ash/common/shelf/shelf_button.cc
+++ b/ash/common/shelf/shelf_button.cc
@@ -32,7 +32,7 @@ namespace {
const int kIconSize = 32;
const int kAttentionThrobDurationMS = 800;
const int kMaxAnimationSeconds = 10;
-const int kIndicatorOffsetFromBottom = 2;
+const int kIndicatorOffsetFromBottom = 3;
const int kIndicatorRadiusDip = 2;
const SkColor kIndicatorColor = SK_ColorWHITE;
@@ -146,11 +146,23 @@ class ShelfButton::AppStatusIndicatorView
DCHECK_EQ(width(), height());
DCHECK_EQ(kIndicatorRadiusDip, width() / 2);
+ const float dsf = canvas->UndoDeviceScaleFactor();
+ const int kStrokeWidthPx = 1;
+ gfx::PointF center = gfx::RectF(GetLocalBounds()).CenterPoint();
+ center.Scale(dsf);
+
+ // Fill the center.
cc::PaintFlags flags;
flags.setColor(kIndicatorColor);
flags.setFlags(cc::PaintFlags::kAntiAlias_Flag);
- canvas->DrawCircle(gfx::Point(width() / 2, height() / 2),
- kIndicatorRadiusDip, flags);
+ canvas->DrawCircle(center, dsf * kIndicatorRadiusDip - kStrokeWidthPx,
+ flags);
+
+ // Stroke the border.
+ flags.setColor(SkColorSetA(SK_ColorBLACK, 0x4D));
+ flags.setStyle(SkPaint::kStroke_Style);
+ canvas->DrawCircle(
+ center, dsf * kIndicatorRadiusDip - kStrokeWidthPx / 2.0f, flags);
}
// ShelfButtonAnimation::Observer
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698