Commit 7d4ead66 authored by Justin Cohen's avatar Justin Cohen Committed by Commit Bot

[ios] Fix tab strip rtl long press frame.

Bug: 865119
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: Ic2a6fdb250075d14306eb4f581b8443f05632d8f
Reviewed-on: https://chromium-review.googlesource.com/1145851
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Reviewed-by: default avatarRohit Rao <rohitrao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577088}
parent d522f454
......@@ -523,11 +523,6 @@ NSString* StringForItemCount(long count) {
- (void)hideTabStrip:(BOOL)hidden {
self.view.hidden = hidden;
if (!hidden) {
NamedGuide* tabSwitcherGuide =
[NamedGuide guideWithName:kTabStripTabSwitcherGuide view:self.view];
tabSwitcherGuide.constrainedView = _tabSwitcherButton;
}
}
#pragma mark - Private
......@@ -751,6 +746,21 @@ NSString* StringForItemCount(long count) {
return [self modelIndexForIndex:[_tabArray indexOfObject:view]];
}
// The |tabSwitcherGuide| cannot use constrainedView in the tab strip because
// here views use CGAffineTransformMakeScale to support RTL, and NamedGuide
// doesn't honor transforms. Instead we set the tabSwitcherGuide as necessary.
- (void)updateTabSwitcherGuide {
NamedGuide* tabSwitcherGuide =
[NamedGuide guideWithName:kTabStripTabSwitcherGuide view:self.view];
tabSwitcherGuide.constrainedFrame = _tabSwitcherButton.frame;
if (UseRTLLayout()) {
CGRect frame = tabSwitcherGuide.constrainedFrame;
frame.origin.x =
self.view.frame.size.width - _tabSwitcherButton.frame.origin.x;
tabSwitcherGuide.constrainedFrame = frame;
}
}
#pragma mark -
#pragma mark Tab Drag and Drop methods
......@@ -1392,6 +1402,7 @@ NSString* StringForItemCount(long count) {
// Creates TabViews for each Tab in the TabModel and positions them in the
// correct location onscreen.
- (void)layoutTabStripSubviews {
[self updateTabSwitcherGuide];
const NSUInteger tabCount = [_tabArray count] - [_closingTabs count];
if (!tabCount)
return;
......
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