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

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

Issue 2411343003: views: lighten stroke for STATE_DISABLED buttons (Closed)
Patch Set: rebase 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 a097ed3977dde41f9c8ffe9598eec6dc4afa72f1..a29530c6346759ebdfb1c752249d87382b2abb32 100644
--- a/ui/views/controls/button/md_text_button.cc
+++ b/ui/views/controls/button/md_text_button.cc
@@ -277,6 +277,14 @@ void MdTextButton::UpdateColors() {
// stroke will also change colors to match.
SkColor stroke_color =
is_prominent_ ? SK_ColorTRANSPARENT : SkColorSetA(text_color, 0x4e);
+
+ // Disabled, non-prominent buttons need their stroke lightened. Prominent
+ // buttons need it left at SK_ColorTRANSPARENT from above.
+ if (state() == STATE_DISABLED && !is_prominent_) {
+ stroke_color = color_utils::BlendTowardOppositeLuma(
+ stroke_color, gfx::kDisabledControlAlpha);
+ }
+
DCHECK_EQ(SK_AlphaOPAQUE, static_cast<int>(SkColorGetA(bg_color)));
set_background(Background::CreateBackgroundPainter(
true, Painter::CreateRoundRectWith1PxBorderPainter(
« 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