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

Unified Diff: ui/views/controls/button/image_button_factory.cc

Issue 2783023002: Use an InsetMetric instead of a constant for vector button padding. (Closed)
Patch Set: revert the stuff that got mixed in from another patch Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/controls/button/image_button_factory.cc
diff --git a/ui/views/controls/button/image_button_factory.cc b/ui/views/controls/button/image_button_factory.cc
index 6cb9c0beace847c0a86d72081f4071951b0e453e..5905b46bc868206ebdacf7e6cf776a26b28a8606 100644
--- a/ui/views/controls/button/image_button_factory.cc
+++ b/ui/views/controls/button/image_button_factory.cc
@@ -11,6 +11,7 @@
#include "ui/views/controls/button/custom_button.h"
#include "ui/views/controls/button/image_button.h"
#include "ui/views/painter.h"
+#include "ui/views/views_delegate.h"
namespace views {
@@ -21,9 +22,9 @@ ImageButton* CreateVectorImageButton(ButtonListener* listener) {
button->SetImageAlignment(ImageButton::ALIGN_CENTER,
ImageButton::ALIGN_MIDDLE);
button->SetFocusPainter(nullptr);
- // Extra space around the buttons to increase their event target size.
- constexpr int kButtonExtraTouchSize = 4;
- button->SetBorder(CreateEmptyBorder(gfx::Insets(kButtonExtraTouchSize)));
+ button->SetBorder(
+ CreateEmptyBorder(ViewsDelegate::GetInstance()->GetInsetsMetric(
+ InsetsMetric::VECTOR_IMAGE_BUTTON_PADDING)));
return button;
}

Powered by Google App Engine
This is Rietveld 408576698