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

Side by Side Diff: ui/views/controls/button/md_text_button.cc

Issue 2409563002: views: use darker stroke for non-prominent buttons (Closed)
Patch Set: use magic alpha value 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/controls/button/md_text_button.h" 5 #include "ui/views/controls/button/md_text_button.h"
6 6
7 #include "base/i18n/case_conversion.h" 7 #include "base/i18n/case_conversion.h"
8 #include "ui/base/material_design/material_design_controller.h" 8 #include "ui/base/material_design/material_design_controller.h"
9 #include "ui/gfx/canvas.h" 9 #include "ui/gfx/canvas.h"
10 #include "ui/gfx/color_palette.h" 10 #include "ui/gfx/color_palette.h"
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 bg_color, gfx::kDisabledControlAlpha); 264 bg_color, gfx::kDisabledControlAlpha);
265 } 265 }
266 266
267 if (state() == STATE_PRESSED) { 267 if (state() == STATE_PRESSED) {
268 SkColor shade = 268 SkColor shade =
269 theme->GetSystemColor(ui::NativeTheme::kColorId_ButtonPressedShade); 269 theme->GetSystemColor(ui::NativeTheme::kColorId_ButtonPressedShade);
270 bg_color = color_utils::GetResultingPaintColor(shade, bg_color); 270 bg_color = color_utils::GetResultingPaintColor(shade, bg_color);
271 } 271 }
272 272
273 SkColor stroke_color = 273 SkColor stroke_color =
274 is_prominent_ ? SK_ColorTRANSPARENT : SkColorSetA(text_color, 0x33); 274 is_prominent_ ? SK_ColorTRANSPARENT : SkColorSetA(text_color, 0x4e);
Evan Stade 2016/10/12 15:28:35 perhaps a note about how this was calculated or wh
Elly Fong-Jones 2016/10/12 17:46:46 Done.
275 DCHECK_EQ(SK_AlphaOPAQUE, static_cast<int>(SkColorGetA(bg_color))); 275 DCHECK_EQ(SK_AlphaOPAQUE, static_cast<int>(SkColorGetA(bg_color)));
276 set_background(Background::CreateBackgroundPainter( 276 set_background(Background::CreateBackgroundPainter(
277 true, Painter::CreateRoundRectWith1PxBorderPainter( 277 true, Painter::CreateRoundRectWith1PxBorderPainter(
278 bg_color, stroke_color, kInkDropSmallCornerRadius))); 278 bg_color, stroke_color, kInkDropSmallCornerRadius)));
279 } 279 }
280 280
281 } // namespace views 281 } // namespace views
OLDNEW
« 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