Commit 91b583c7 authored by Justin Cohen's avatar Justin Cohen Committed by Commit Bot

[ios] Tab strip UI polish.

Bug: 857431
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I1c8ae739deab88470f40e5b3c2e241406ecb233e
Reviewed-on: https://chromium-review.googlesource.com/1138797
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575661}
parent 3407cf53
......@@ -72,7 +72,11 @@ const NSTimeInterval kDragAndDropLongPressDuration = 0.4;
const CGFloat kTabOverlap = 26.0;
const CGFloat kTabOverlapForCompactLayout = 30.0;
const CGFloat kNewTabOverlap = 8.0;
const CGFloat kNewTabOverlap = 13.0;
const CGFloat kNewTabOverlapLegacy = 8.0;
CGFloat NewTabOverlap() {
return IsUIRefreshPhase1Enabled() ? kNewTabOverlap : kNewTabOverlapLegacy;
}
const CGFloat kMaxTabWidth = 265.0;
const CGFloat kMaxTabWidthForCompactLayout = 225.0;
......@@ -1100,7 +1104,7 @@ NSString* StringForItemCount(long count) {
- (CGFloat)tabStripVisibleSpace {
CGFloat availableSpace = CGRectGetWidth([_tabStripView bounds]) -
CGRectGetWidth([_buttonNewTab frame]) +
kNewTabOverlap;
NewTabOverlap();
return availableSpace;
}
......@@ -1214,7 +1218,7 @@ NSString* StringForItemCount(long count) {
// desired width, with the standard overlap, plus the new tab button.
CGSize contentSize = CGSizeMake(
_currentTabWidth * tabCount - ([self tabOverlap] * (tabCount - 1)) +
CGRectGetWidth([_buttonNewTab frame]) - kNewTabOverlap,
CGRectGetWidth([_buttonNewTab frame]) - NewTabOverlap(),
tabHeight);
if (CGSizeEqualToSize([_tabStripView contentSize], contentSize))
return;
......@@ -1631,7 +1635,7 @@ NSString* StringForItemCount(long count) {
CGRect newTabFrame = [_buttonNewTab frame];
BOOL moveNewTab =
(newTabFrame.origin.x != virtualMaxX) && !_buttonNewTab.hidden;
newTabFrame.origin = CGPointMake(virtualMaxX - kNewTabOverlap, 0);
newTabFrame.origin = CGPointMake(virtualMaxX - NewTabOverlap(), 0);
if (!animate && moveNewTab)
[_buttonNewTab setFrame:newTabFrame];
......
......@@ -45,7 +45,8 @@ const CGFloat kFaviconLeftInset = 23.5;
const CGFloat kFaviconVerticalOffset = 2.0;
const CGFloat kTabStripLineMargin = 2.5;
const CGFloat kTabStripLineHeight = 0.5;
const CGFloat kCloseButtonHorizontalShift = 15;
const CGFloat kCloseButtonHorizontalShift = 19;
const CGFloat kCloseButtonHorizontalShiftLegacy = 15;
const CGFloat kCloseButtonVerticalShift = 4.0;
const CGFloat kTitleLeftMargin = 8.0;
const CGFloat kTitleRightMargin = 0.0;
......@@ -352,7 +353,9 @@ const CGFloat kFaviconSize = 16.0;
@"V:[title(==titleHeight)]",
];
CGFloat closeButtonHorizontalShift = kCloseButtonHorizontalShift;
CGFloat closeButtonHorizontalShift = IsUIRefreshPhase1Enabled()
? kCloseButtonHorizontalShift
: kCloseButtonHorizontalShiftLegacy;
CGFloat faviconLeftInset = kFaviconLeftInset;
CGFloat faviconVerticalOffset = kFaviconVerticalOffset;
CGFloat closeButtonVerticalShift = kCloseButtonVerticalShift;
......
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