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

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

Issue 2696263002: Refactor ViewsDelegate and MD-ify the icon-to-text spacing for checkbox and radiobutton (Closed)
Patch Set: Merged with latest changes. Created 3 years, 10 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/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 b5e6c1b0e1e98ef5c9151ffb11d85053fe5f3ecb..d134878bbd7eb1c97064bab3168ea44c470ee76b 100644
--- a/ui/views/controls/button/md_text_button.cc
+++ b/ui/views/controls/button/md_text_button.cc
@@ -193,8 +193,8 @@ MdTextButton::MdTextButton(ButtonListener* listener)
set_has_ink_drop_action_on_click(true);
SetHorizontalAlignment(gfx::ALIGN_CENTER);
SetFocusForPlatform();
- const int minimum_width =
- ViewsDelegate::GetInstance()->GetButtonMinimumWidth();
+ const int minimum_width = ViewsDelegate::GetInstance()->GetSpacingMetric(
+ SpacingMetric::DIALOG_BUTTON_MINIMUM_WIDTH);
SetMinSize(gfx::Size(minimum_width, 0));
SetFocusPainter(nullptr);
label()->SetAutoColorReadabilityEnabled(false);
@@ -240,8 +240,8 @@ void MdTextButton::UpdatePadding() {
// TODO(estade): can we get rid of the platform style border hoopla if
// we apply the MD treatment to all buttons, even GTK buttons?
- const int horizontal_padding =
- ViewsDelegate::GetInstance()->GetButtonHorizontalPadding();
+ const int horizontal_padding = ViewsDelegate::GetInstance()->GetSpacingMetric(
+ SpacingMetric::BUTTON_HORIZONTAL_PADDING);
SetBorder(CreateEmptyBorder(top_padding, horizontal_padding, bottom_padding,
horizontal_padding));
}

Powered by Google App Engine
This is Rietveld 408576698