Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix #8547: Page zoom freeze (#8570)
Browse files Browse the repository at this point in the history
Fix autolayout issue

Co-authored-by: Brandon T <[email protected]>
  • Loading branch information
iccub and Brandon-T committed Dec 15, 2023
1 parent aceefcd commit fd6b34b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Sources/Brave/Frontend/Browser/BrowserViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1529,7 +1529,7 @@ public class BrowserViewController: UIViewController {
toolbar?.line.isHidden = isUsingBottomBar
}

header.expandedBarStackView.removeArrangedSubview(tabsBar.view)
tabsBar.view.removeFromSuperview()
if isUsingBottomBar {
header.expandedBarStackView.insertArrangedSubview(tabsBar.view, at: 0)
} else {
Expand Down Expand Up @@ -2297,11 +2297,6 @@ public class BrowserViewController: UIViewController {
func displayPageZoom(visible: Bool) {
if !visible || pageZoomBar != nil {
pageZoomBar?.view.removeFromSuperview()

if let zoomBarView = pageZoomBar?.view {
alertStackView.removeArrangedSubview(zoomBarView)
}

updateViewConstraints()
pageZoomBar = nil

Expand Down Expand Up @@ -2335,6 +2330,7 @@ public class BrowserViewController: UIViewController {

pageZoomBar.view.snp.makeConstraints { make in
make.height.greaterThanOrEqualTo(UIConstants.toolbarHeight)
make.height.equalTo(UIConstants.toolbarHeight).priority(.high)
make.edges.equalTo(alertStackView)
}

Expand Down
2 changes: 2 additions & 0 deletions Sources/Brave/Frontend/Browser/PageZoom/PageZoomView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ struct PageZoomView: View {
HStack(spacing: 0.0) {
Text(Strings.PageZoom.zoomViewText)
.font(.system(.subheadline))
.fixedSize(horizontal: false, vertical: true)
.frame(maxWidth: .infinity, alignment: .leading)

ZoomView(
Expand All @@ -151,6 +152,7 @@ struct PageZoomView: View {
.padding(.vertical, 6.0)
}
.background(Color(UIColor.braveBackground))
.ignoresSafeArea()
}

private func storeChanges() {
Expand Down

0 comments on commit fd6b34b

Please sign in to comment.