| 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 a29530c6346759ebdfb1c752249d87382b2abb32..6b914ac5dbaa6f56bc2b0a869b85f1e53fb10548 100644
|
| --- a/ui/views/controls/button/md_text_button.cc
|
| +++ b/ui/views/controls/button/md_text_button.cc
|
| @@ -91,6 +91,15 @@ void MdTextButton::SetBgColorOverride(const base::Optional<SkColor>& color) {
|
| UpdateColors();
|
| }
|
|
|
| +void MdTextButton::OnPaintBackground(gfx::Canvas* canvas) {
|
| + LabelButton::OnPaintBackground(canvas);
|
| + if (hover_animation().is_animating() || state() == STATE_HOVERED) {
|
| + const int kHoverAlpha = is_prominent_ ? 0x0c : 0x05;
|
| + SkScalar alpha = hover_animation().CurrentValueBetween(0, kHoverAlpha);
|
| + canvas->FillRect(GetLocalBounds(), SkColorSetA(SK_ColorBLACK, alpha));
|
| + }
|
| +}
|
| +
|
| void MdTextButton::OnFocus() {
|
| LabelButton::OnFocus();
|
| FocusRing::Install(this);
|
| @@ -192,6 +201,8 @@ MdTextButton::MdTextButton(ButtonListener* listener)
|
| set_request_focus_on_press(false);
|
| LabelButton::SetFontList(GetMdFontList());
|
|
|
| + set_animate_on_state_change(true);
|
| +
|
| // Paint to a layer so that the canvas is snapped to pixel boundaries (useful
|
| // for fractional DSF).
|
| SetPaintToLayer(true);
|
|
|