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

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

Issue 2696263002: Refactor ViewsDelegate and MD-ify the icon-to-text spacing for checkbox and radiobutton (Closed)
Patch Set: Used ifdef instead of duplicated code for delegate initialization 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
« no previous file with comments | « ui/views/bubble/bubble_frame_view.cc ('k') | ui/views/controls/button/md_text_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « ui/views/bubble/bubble_frame_view.cc ('k') | ui/views/controls/button/md_text_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698