Commit b531bc1a authored by Mark Cogan's avatar Mark Cogan Committed by Commit Bot

[iOS] Fix spacing between grid cell title and close button.

This Cl fixes the spacing between the grid cell title and the close
button. When setting a constant offset for a trailing anchor, a positive
constant results in the trailing anchor being further in the trailing
direction, so a negative constant is needed to ensure the trailing anchor is on
the leading side of the anchor it is constrained to.

Per UX, the offset between the label and the button is set to 4 points.

Bug: 862343
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I01fc0e927c281ea5b174af4126c7e44fd3fc4f7f
Reviewed-on: https://chromium-review.googlesource.com/1140316Reviewed-by: default avataredchin <edchin@chromium.org>
Commit-Queue: edchin <edchin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576145}
parent 017a1bcf
...@@ -260,7 +260,7 @@ void PositionView(UIView* view, CGPoint point) { ...@@ -260,7 +260,7 @@ void PositionView(UIView* view, CGPoint point) {
[titleLabel.centerYAnchor constraintEqualToAnchor:topBar.centerYAnchor], [titleLabel.centerYAnchor constraintEqualToAnchor:topBar.centerYAnchor],
[titleLabel.trailingAnchor [titleLabel.trailingAnchor
constraintLessThanOrEqualToAnchor:closeIconView.leadingAnchor constraintLessThanOrEqualToAnchor:closeIconView.leadingAnchor
constant:kGridCellCloseButtonContentInset], constant:-kGridCellTitleLabelContentInset],
[closeIconView.topAnchor constraintEqualToAnchor:topBar.topAnchor], [closeIconView.topAnchor constraintEqualToAnchor:topBar.topAnchor],
[closeIconView.bottomAnchor constraintEqualToAnchor:topBar.bottomAnchor], [closeIconView.bottomAnchor constraintEqualToAnchor:topBar.bottomAnchor],
[closeIconView.trailingAnchor [closeIconView.trailingAnchor
......
...@@ -74,6 +74,7 @@ extern const CGFloat kGridCellHeaderHeight; ...@@ -74,6 +74,7 @@ extern const CGFloat kGridCellHeaderHeight;
extern const CGFloat kGridCellHeaderLeadingInset; extern const CGFloat kGridCellHeaderLeadingInset;
extern const CGFloat kGridCellCloseTapTargetWidthHeight; extern const CGFloat kGridCellCloseTapTargetWidthHeight;
extern const CGFloat kGridCellCloseButtonContentInset; extern const CGFloat kGridCellCloseButtonContentInset;
extern const CGFloat kGridCellTitleLabelContentInset;
extern const CGFloat kGridCellIconDiameter; extern const CGFloat kGridCellIconDiameter;
extern const CGFloat kGridCellSelectionRingGapWidth; extern const CGFloat kGridCellSelectionRingGapWidth;
extern const CGFloat kGridCellSelectionRingTintWidth; extern const CGFloat kGridCellSelectionRingTintWidth;
......
...@@ -71,6 +71,7 @@ const CGFloat kGridCellHeaderHeight = 32.0f; ...@@ -71,6 +71,7 @@ const CGFloat kGridCellHeaderHeight = 32.0f;
const CGFloat kGridCellHeaderLeadingInset = 5.0f; const CGFloat kGridCellHeaderLeadingInset = 5.0f;
const CGFloat kGridCellCloseTapTargetWidthHeight = 44.0f; const CGFloat kGridCellCloseTapTargetWidthHeight = 44.0f;
const CGFloat kGridCellCloseButtonContentInset = 8.5f; const CGFloat kGridCellCloseButtonContentInset = 8.5f;
const CGFloat kGridCellTitleLabelContentInset = 4.0f;
const CGFloat kGridCellIconDiameter = 22.0f; const CGFloat kGridCellIconDiameter = 22.0f;
const CGFloat kGridCellSelectionRingGapWidth = 2.0f; const CGFloat kGridCellSelectionRingGapWidth = 2.0f;
const CGFloat kGridCellSelectionRingTintWidth = 5.0f; const CGFloat kGridCellSelectionRingTintWidth = 5.0f;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment