Index: ui/views/controls/button/label_button.cc |
diff --git a/ui/views/controls/button/label_button.cc b/ui/views/controls/button/label_button.cc |
index 4a7cfd912fab2b1bdd0ce463176fc6b501408a15..028c4710a5d229dedb6e0b80ca9290327018c242 100644 |
--- a/ui/views/controls/button/label_button.cc |
+++ b/ui/views/controls/button/label_button.cc |
@@ -25,15 +25,14 @@ |
#include "ui/views/animation/square_ink_drop_ripple.h" |
#include "ui/views/background.h" |
#include "ui/views/controls/button/label_button_border.h" |
+#include "ui/views/layout/layout_constants.h" |
#include "ui/views/painter.h" |
#include "ui/views/style/platform_style.h" |
+#include "ui/views/views_delegate.h" |
#include "ui/views/window/dialog_delegate.h" |
namespace { |
-// The default spacing between the icon and text. |
-const int kSpacing = 5; |
- |
gfx::Font::Weight GetValueBolderThan(gfx::Font::Weight weight) { |
if (weight < gfx::Font::Weight::BOLD) |
return gfx::Font::Weight::BOLD; |
@@ -93,7 +92,8 @@ LabelButton::LabelButton(ButtonListener* listener, const base::string16& text) |
is_default_(false), |
style_(STYLE_TEXTBUTTON), |
border_is_themed_border_(true), |
- image_label_spacing_(kSpacing), |
+ image_label_spacing_(ViewsDelegate::GetInstance()->GetDistanceMetric( |
+ DistanceMetric::RELATED_CONTROL_HORIZONTAL)), |
horizontal_alignment_(gfx::ALIGN_LEFT) { |
SetAnimationDuration(kHoverAnimationDurationMs); |
SetTextInternal(text); |