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

Unified Diff: ios/chrome/browser/ui/omnibox/omnibox_popup_material_row.mm

Issue 2629723002: Fix the layout of the append button on Answers in Suggest. (Closed)
Patch Set: Created 3 years, 11 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: ios/chrome/browser/ui/omnibox/omnibox_popup_material_row.mm
diff --git a/ios/chrome/browser/ui/omnibox/omnibox_popup_material_row.mm b/ios/chrome/browser/ui/omnibox/omnibox_popup_material_row.mm
index 71f2f216c1bd58017ed22cf9515b6cd31083135d..9d066dcdb6b7a4d15c4a58e993a3f359b2d272b9 100644
--- a/ios/chrome/browser/ui/omnibox/omnibox_popup_material_row.mm
+++ b/ios/chrome/browser/ui/omnibox/omnibox_popup_material_row.mm
@@ -17,6 +17,7 @@ const CGFloat kImageDimensionLength = 19.0;
const CGFloat kLeadingPaddingIpad = 164;
const CGFloat kLeadingPaddingIpadCompact = 71;
const CGFloat kAppendButtonTrailingMargin = 4;
+const CGFloat kAppendButtonSize = 48.0;
}
@interface OmniboxPopupMaterialRow () {
@@ -78,7 +79,7 @@ const CGFloat kAppendButtonTrailingMargin = 4;
[self updatePhysicalWebImage];
[self addSubview:_physicalWebButton];
- // Left icon is only displayed on iPad.
+ // Leading icon is only displayed on iPad.
if (IsIPadIdiom()) {
_imageView = [[UIImageView alloc] initWithFrame:CGRectZero];
_imageView.userInteractionEnabled = NO;
@@ -110,19 +111,16 @@ const CGFloat kAppendButtonTrailingMargin = 4;
kImageDimensionLength);
_imageView.frame = LayoutRectGetRect(imageViewLayout);
- CGFloat appendButtonDimensionLength = CGRectGetHeight(self.bounds);
- DCHECK_GT(appendButtonDimensionLength, 40);
- LayoutRect rightAccessoryLayout =
- LayoutRectMake(CGRectGetWidth(self.bounds) - appendButtonDimensionLength -
- kAppendButtonTrailingMargin,
- CGRectGetWidth(self.bounds),
- floor((_rowHeight - appendButtonDimensionLength) / 2),
- appendButtonDimensionLength, appendButtonDimensionLength);
- _appendButton.frame = LayoutRectGetRect(rightAccessoryLayout);
- _physicalWebButton.frame = LayoutRectGetRect(rightAccessoryLayout);
+ LayoutRect trailingAccessoryLayout = LayoutRectMake(
+ CGRectGetWidth(self.bounds) - kAppendButtonSize -
+ kAppendButtonTrailingMargin,
+ CGRectGetWidth(self.bounds), floor((_rowHeight - kAppendButtonSize) / 2),
+ kAppendButtonSize, kAppendButtonSize);
+ _appendButton.frame = LayoutRectGetRect(trailingAccessoryLayout);
+ _physicalWebButton.frame = LayoutRectGetRect(trailingAccessoryLayout);
}
-- (void)updateLeftImage:(int)imageID {
+- (void)updateLeadingImage:(int)imageID {
_imageView.image = NativeImage(imageID);
// Adjust the vertical position based on the current size of the row.

Powered by Google App Engine
This is Rietveld 408576698