Skip to content

Commit

Permalink
Adjust for bottom bar insets in New Tab Page
Browse files Browse the repository at this point in the history
  • Loading branch information
dus7 committed Jul 30, 2024
1 parent ad7e940 commit 1a80e94
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions DuckDuckGo/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,16 @@ class MainViewController: UIViewController {
}
}

adjustNewTabPageSafeAreaInsets(for: position)
}

private func adjustNewTabPageSafeAreaInsets(for addressBarPosition: AddressBarPosition) {
switch addressBarPosition {
case .top:
newTabPageViewController?.additionalSafeAreaInsets = .zero
case .bottom:
newTabPageViewController?.additionalSafeAreaInsets = .init(top: 0, left: 0, bottom: 52, right: 0)
}
}

@objc func onShowFullSiteAddressChanged() {
Expand Down Expand Up @@ -742,6 +752,7 @@ class MainViewController: UIViewController {
newTabPageViewController = controller
addToContentContainer(controller: controller)
viewCoordinator.logoContainer.isHidden = true
adjustNewTabPageSafeAreaInsets(for: appSettings.currentAddressBarPosition)
} else {
let controller = HomeViewController.loadFromStoryboard(homePageConfiguration: homePageConfiguration,
model: tabModel,
Expand Down

0 comments on commit 1a80e94

Please sign in to comment.