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

Unified Diff: ui/views/controls/button/md_text_button.cc

Issue 2395843003: views: fix MdTextButton stroke alpha (Closed)
Patch Set: Created 4 years, 2 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: ui/views/controls/button/md_text_button.cc
diff --git a/ui/views/controls/button/md_text_button.cc b/ui/views/controls/button/md_text_button.cc
index 43d7b153fc274eb01c463d866b5be109677c3bb3..b232477cc596d8b0fdd1e11c6d077438f558f193 100644
--- a/ui/views/controls/button/md_text_button.cc
+++ b/ui/views/controls/button/md_text_button.cc
@@ -264,8 +264,11 @@ void MdTextButton::UpdateColors() {
bg_color = color_utils::GetResultingPaintColor(shade, bg_color);
}
- const SkAlpha kStrokeOpacity = 0x1A;
- SkColor stroke_color = (is_prominent_ || color_utils::IsDark(text_color))
+ // Prominent buttons have no outside stroke at all. Fake it by using zero
+ // opacity so the code below can still use
+ // CreateRoundRectWith1PxBorderPainter().
+ const SkAlpha kStrokeOpacity = is_prominent_ ? 0x00 : 0x33;
+ SkColor stroke_color = color_utils::IsDark(text_color)
? SkColorSetA(SK_ColorBLACK, kStrokeOpacity)
: SkColorSetA(SK_ColorWHITE, 2 * kStrokeOpacity);
« 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