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

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

Issue 2070143003: Add MD ink drop ripple to app list button (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@b612539_shelf_button_ripple
Patch Set: Rebased Created 4 years, 5 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 | « ui/views/controls/button/custom_button_unittest.cc ('k') | 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_utils.h" 10 #include "ui/gfx/color_utils.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 } 207 }
208 208
209 void MdTextButton::UpdateStyleToIndicateDefaultStatus() { 209 void MdTextButton::UpdateStyleToIndicateDefaultStatus() {
210 UpdateColors(); 210 UpdateColors();
211 } 211 }
212 212
213 MdTextButton::MdTextButton(ButtonListener* listener) 213 MdTextButton::MdTextButton(ButtonListener* listener)
214 : LabelButton(listener, base::string16()), 214 : LabelButton(listener, base::string16()),
215 focus_ring_(new internal::MdFocusRing()), 215 focus_ring_(new internal::MdFocusRing()),
216 is_cta_(false) { 216 is_cta_(false) {
217 SetHasInkDrop(true); 217 SetInkDropMode(InkDropMode::ON);
218 set_has_ink_drop_action_on_click(true); 218 set_has_ink_drop_action_on_click(true);
219 SetHorizontalAlignment(gfx::ALIGN_CENTER); 219 SetHorizontalAlignment(gfx::ALIGN_CENTER);
220 SetFocusForPlatform(); 220 SetFocusForPlatform();
221 SetMinSize(gfx::Size(kMinWidth, 0)); 221 SetMinSize(gfx::Size(kMinWidth, 0));
222 SetFocusPainter(nullptr); 222 SetFocusPainter(nullptr);
223 label()->SetAutoColorReadabilityEnabled(false); 223 label()->SetAutoColorReadabilityEnabled(false);
224 SetFontList(GetMdFontList()); 224 SetFontList(GetMdFontList());
225 225
226 AddChildView(focus_ring_); 226 AddChildView(focus_ring_);
227 focus_ring_->SetVisible(false); 227 focus_ring_->SetVisible(false);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 SkColor stroke_color = (is_cta_ || color_utils::IsDark(text_color)) 273 SkColor stroke_color = (is_cta_ || color_utils::IsDark(text_color))
274 ? SkColorSetA(SK_ColorBLACK, kStrokeOpacity) 274 ? SkColorSetA(SK_ColorBLACK, kStrokeOpacity)
275 : SkColorSetA(SK_ColorWHITE, 2 * kStrokeOpacity); 275 : SkColorSetA(SK_ColorWHITE, 2 * kStrokeOpacity);
276 276
277 set_background(Background::CreateBackgroundPainter( 277 set_background(Background::CreateBackgroundPainter(
278 true, Painter::CreateRoundRectWith1PxBorderPainter( 278 true, Painter::CreateRoundRectWith1PxBorderPainter(
279 bg_color, stroke_color, kInkDropSmallCornerRadius))); 279 bg_color, stroke_color, kInkDropSmallCornerRadius)));
280 } 280 }
281 281
282 } // namespace views 282 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/custom_button_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698