| 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 9b3d05986a6469e9d7ec436c6575f13065149d8d..d1b6f9559a8533de11c403020a4885eb88131a85 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_animates_hover(true);
|
| +
|
| // Paint to a layer so that the canvas is snapped to pixel boundaries (useful
|
| // for fractional DSF).
|
| SetPaintToLayer(true);
|
|
|