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

Unified Diff: chrome/browser/ui/views/harmony/harmony_layout_delegate.cc

Issue 2783023002: Use an InsetMetric instead of a constant for vector button padding. (Closed)
Patch Set: 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 | « chrome/browser/ui/views/chrome_views_delegate.cc ('k') | chrome/browser/ui/views/harmony/layout_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/harmony/harmony_layout_delegate.cc
diff --git a/chrome/browser/ui/views/harmony/harmony_layout_delegate.cc b/chrome/browser/ui/views/harmony/harmony_layout_delegate.cc
index 57f90992c019c21ba18590ebbbad9fd623c760fc..44c5a75039a839ebe148e52dbc02dc54e939e60a 100644
--- a/chrome/browser/ui/views/harmony/harmony_layout_delegate.cc
+++ b/chrome/browser/ui/views/harmony/harmony_layout_delegate.cc
@@ -31,9 +31,10 @@ int HarmonyLayoutDelegate::GetMetric(Metric metric) const {
case Metric::DIALOG_BUTTON_TOP_SPACING:
return kHarmonyLayoutUnit;
case Metric::DIALOG_CLOSE_BUTTON_MARGIN:
- // TODO(pkasting): The "- 4" here is a hack that matches the extra padding
- // in vector_icon_button.cc and should be removed when that padding is.
- return (kHarmonyLayoutUnit / 2) - 4;
+ // The amount of padding doesn't affect the button's position, so subtract
+ // it out here.
Peter Kasting 2017/03/29 22:39:42 Nit: Maybe clearer: constexpr int kVisibleM
Bret 2017/03/29 23:06:11 Done.
+ return (kHarmonyLayoutUnit / 2) -
+ GetMetric(Metric::VECTOR_IMAGE_BUTTON_PADDING);
case Metric::PANEL_CONTENT_MARGIN:
return kHarmonyLayoutUnit;
case Metric::RELATED_BUTTON_HORIZONTAL_SPACING:
@@ -58,6 +59,8 @@ int HarmonyLayoutDelegate::GetMetric(Metric metric) const {
return kHarmonyLayoutUnit;
case Metric::UNRELATED_CONTROL_VERTICAL_SPACING_LARGE:
return kHarmonyLayoutUnit;
+ case Metric::VECTOR_IMAGE_BUTTON_PADDING:
+ return 4;
Peter Kasting 2017/03/29 22:39:42 Nit: It seems like if we scaled up the layout unit
Bret 2017/03/29 23:06:11 I went back and forth on this. It's not really a l
}
NOTREACHED();
return 0;
« no previous file with comments | « chrome/browser/ui/views/chrome_views_delegate.cc ('k') | chrome/browser/ui/views/harmony/layout_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698