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

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: 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/controls/button/label_button.cc ('k') | ui/views/examples/dialog_example.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..4453f2a2aa72f428b0e7519f9061938bcb93d4fb 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()->GetDistanceMetric(
+ DistanceMetric::DIALOG_BUTTON_MINIMUM_WIDTH);
SetMinSize(gfx::Size(minimum_width, 0));
SetFocusPainter(nullptr);
label()->SetAutoColorReadabilityEnabled(false);
@@ -241,7 +241,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();
+ ViewsDelegate::GetInstance()->GetDistanceMetric(
+ DistanceMetric::BUTTON_HORIZONTAL_PADDING);
SetBorder(CreateEmptyBorder(top_padding, horizontal_padding, bottom_padding,
horizontal_padding));
}
« no previous file with comments | « ui/views/controls/button/label_button.cc ('k') | ui/views/examples/dialog_example.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698