Commit d573e8b2 authored by edchin's avatar edchin Committed by Commit Bot

[ios] Fix tabgrid rotation content inset bug

This CL fixes the issue in which the bottom toolbar covers
over the last row of tabs. This was caused by the inset not being
properly reset when rotating between portrait and landscape.

The TabGridBottomToolbar is smart about rotation changes. It
automatically adjusts it's intrinsicContentSize, so this does
not need to be adjusted by the TabGridViewController. The user
of TabGridBottomToolbar just needs to set insets to the
intrinsicContentSize given by TabGridBottomToolbar.

Bug: 1003768
Change-Id: Ib61039bf7d872ebe27d1971ba5848afafa643af0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1874611Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Reviewed-by: default avataredchin <edchin@chromium.org>
Commit-Queue: edchin <edchin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708646}
parent edba5cbe
...@@ -429,9 +429,7 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) { ...@@ -429,9 +429,7 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) {
} }
// The content inset of the tab grids must be modified so that the toolbars // The content inset of the tab grids must be modified so that the toolbars
// do not obscure the tabs. This may change depending on orientation. // do not obscure the tabs. This may change depending on orientation.
CGFloat bottomInset = self.configuration == TabGridConfigurationBottomToolbar CGFloat bottomInset = self.bottomToolbar.intrinsicContentSize.height;
? self.bottomToolbar.intrinsicContentSize.height
: 0;
UIEdgeInsets inset = UIEdgeInsetsMake( UIEdgeInsets inset = UIEdgeInsetsMake(
self.topToolbar.intrinsicContentSize.height, 0, bottomInset, 0); self.topToolbar.intrinsicContentSize.height, 0, bottomInset, 0);
// Left and right side could be missing correct safe area // Left and right side could be missing correct safe area
......
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