Chromium Code Reviews| Index: ios/chrome/browser/ui/qr_scanner/qr_scanner_view.mm |
| diff --git a/ios/chrome/browser/ui/qr_scanner/qr_scanner_view.mm b/ios/chrome/browser/ui/qr_scanner/qr_scanner_view.mm |
| index 2101964d24e869103647dbd2bad3b2520181af46..d9fce117737114df4be2f6df24a79b8fd09c529c 100644 |
| --- a/ios/chrome/browser/ui/qr_scanner/qr_scanner_view.mm |
| +++ b/ios/chrome/browser/ui/qr_scanner/qr_scanner_view.mm |
| @@ -41,7 +41,9 @@ const CGFloat kViewportBorderShadowOpacity = 1.0; |
| // Shadow radius of the viewport border. |
| const CGFloat kViewportBorderShadowRadius = 10.0; |
| // Padding of the viewport caption, below the viewport. |
| -const CGFloat kViewportCaptionPadding = 24.0; |
| +const CGFloat kViewportCaptionVerticalPadding = 14.0; |
| +// Padding of the viewport caption from the edges of the superview. |
| +const CGFloat kViewportCaptionHorizontalPadding = 20.0; |
| // Shadow opacity of the viewport caption. |
| const CGFloat kViewportCaptionShadowOpacity = 1.0; |
| // Shadow radius of the viewport caption. |
| @@ -470,6 +472,8 @@ CGFloat GetViewportSize() { |
| UILabel* viewportCaption = [[[UILabel alloc] init] autorelease]; |
| NSString* label = l10n_util::GetNSString(IDS_IOS_QR_SCANNER_VIEWPORT_CAPTION); |
| [viewportCaption setText:label]; |
| + [viewportCaption setNumberOfLines:0]; |
| + [viewportCaption setTextAlignment:NSTextAlignmentCenter]; |
| [viewportCaption setAccessibilityLabel:label]; |
| [viewportCaption setAccessibilityIdentifier:@"qr_scanner_viewport_caption"]; |
| [viewportCaption setTextColor:[UIColor whiteColor]]; |
| @@ -486,9 +490,15 @@ CGFloat GetViewportSize() { |
| [NSLayoutConstraint activateConstraints:@[ |
| [[viewportCaption centerXAnchor] |
| constraintEqualToAnchor:[self centerXAnchor]], |
| - [[viewportCaption centerYAnchor] |
| + [[viewportCaption topAnchor] |
|
gambard
2017/02/22 10:49:04
Don't we want to just align on the _previewView.bo
jif
2017/02/22 12:42:15
_previewView is the view that contains the video.
|
| constraintEqualToAnchor:[self centerYAnchor] |
| - constant:GetViewportSize() / 2 + kViewportCaptionPadding] |
| + constant:GetViewportSize() / 2 + |
| + kViewportCaptionVerticalPadding], |
| + [viewportCaption.widthAnchor |
|
gambard
2017/02/22 10:49:04
Why using this and not constraints on leading/trai
jif
2017/02/22 12:42:15
Done.
|
| + constraintLessThanOrEqualToAnchor:self.widthAnchor |
| + multiplier:1.0 |
| + constant:-2 * |
| + kViewportCaptionHorizontalPadding] |
| ]]; |
| } |