| Index: ui/views/controls/button/vector_icon_button.cc
|
| diff --git a/ui/views/controls/button/vector_icon_button.cc b/ui/views/controls/button/vector_icon_button.cc
|
| index c3e1ba2b684548a673a7d3b1f16b6af532f51a8e..5bbe0806f18a587218a64642f1db0c90684fee2b 100644
|
| --- a/ui/views/controls/button/vector_icon_button.cc
|
| +++ b/ui/views/controls/button/vector_icon_button.cc
|
| @@ -8,19 +8,15 @@
|
| #include "ui/gfx/color_utils.h"
|
| #include "ui/gfx/paint_vector_icon.h"
|
| #include "ui/gfx/vector_icons_public.h"
|
| +#include "ui/views/animation/ink_drop_highlight.h"
|
| +#include "ui/views/animation/ink_drop_ripple.h"
|
| #include "ui/views/border.h"
|
| #include "ui/views/controls/button/vector_icon_button_delegate.h"
|
| #include "ui/views/painter.h"
|
| +#include "ui/views/views_delegate.h"
|
|
|
| namespace views {
|
|
|
| -namespace {
|
| -
|
| -// Extra space around the buttons to increase their event target size.
|
| -const int kButtonExtraTouchSize = 4;
|
| -
|
| -} // namespace
|
| -
|
| VectorIconButton::VectorIconButton(VectorIconButtonDelegate* delegate)
|
| : ImageButton(delegate),
|
| delegate_(delegate),
|
| @@ -55,9 +51,20 @@ void VectorIconButton::OnNativeThemeChanged(const ui::NativeTheme* theme) {
|
| UpdateImagesAndColors();
|
| }
|
|
|
| +std::unique_ptr<InkDropRipple> VectorIconButton::CreateInkDropRipple() const {
|
| + return CreateDefaultInkDropRipple(GetLocalBounds().CenterPoint(), size());
|
| +}
|
| +
|
| +std::unique_ptr<InkDropHighlight> VectorIconButton::CreateInkDropHighlight()
|
| + const {
|
| + return CreateDefaultInkDropHighlight(
|
| + gfx::RectF(GetLocalBounds()).CenterPoint(), size());
|
| +}
|
| +
|
| void VectorIconButton::OnSetIcon() {
|
| - if (!border())
|
| - SetBorder(CreateEmptyBorder(gfx::Insets(kButtonExtraTouchSize)));
|
| + const gfx::Insets insets = ViewsDelegate::GetInstance()->GetButtonMargins();
|
| + if (!border() && !insets.IsEmpty())
|
| + SetBorder(CreateEmptyBorder(insets));
|
|
|
| UpdateImagesAndColors();
|
| }
|
|
|