mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-12-01 09:50:16 +00:00
Fix bug hiding the space for the toolbar when in fullscreen. Fixes #5234.
This commit is contained in:
1 parent
da41360cee
commit
e96aa92fdb
1 file changed
+15
-1
@@ -94,6 +94,13 @@ final class WebViewController: UIViewController {
|
||||
loadWebView()
|
||||
}
|
||||
|
||||
override func viewSafeAreaInsetsDidChange() {
|
||||
super.viewSafeAreaInsetsDidChange()
|
||||
if isFullScreenAvailable && AppDefaults.shared.logicalArticleFullscreenEnabled {
|
||||
updateBottomSafeAreaForFullScreen()
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Notifications
|
||||
|
||||
@objc func feedIconDidBecomeAvailable(_ note: Notification) {
|
||||
@@ -216,6 +223,7 @@ final class WebViewController: UIViewController {
|
||||
bottomShowBarsViewConstraint?.constant = 0
|
||||
navigationController?.setNavigationBarHidden(false, animated: true)
|
||||
navigationController?.setToolbarHidden(false, animated: true)
|
||||
additionalSafeAreaInsets.bottom = 0
|
||||
configureContextMenuInteraction()
|
||||
}
|
||||
|
||||
@@ -227,6 +235,7 @@ final class WebViewController: UIViewController {
|
||||
bottomShowBarsViewConstraint?.constant = 44.0
|
||||
navigationController?.setNavigationBarHidden(true, animated: true)
|
||||
navigationController?.setToolbarHidden(true, animated: true)
|
||||
updateBottomSafeAreaForFullScreen()
|
||||
configureContextMenuInteraction()
|
||||
}
|
||||
}
|
||||
@@ -724,7 +733,7 @@ private extension WebViewController {
|
||||
|
||||
func configureBottomShowBarsView() {
|
||||
bottomShowBarsView = UIView()
|
||||
topShowBarsView.backgroundColor = .clear
|
||||
bottomShowBarsView.backgroundColor = .clear
|
||||
bottomShowBarsView.translatesAutoresizingMaskIntoConstraints = false
|
||||
view.addSubview(bottomShowBarsView)
|
||||
if AppDefaults.shared.logicalArticleFullscreenEnabled {
|
||||
@@ -741,6 +750,11 @@ private extension WebViewController {
|
||||
bottomShowBarsView.addGestureRecognizer(UITapGestureRecognizer(target: self, action: #selector(showBars(_:))))
|
||||
}
|
||||
|
||||
func updateBottomSafeAreaForFullScreen() {
|
||||
let rawBottom = view.safeAreaInsets.bottom - additionalSafeAreaInsets.bottom
|
||||
additionalSafeAreaInsets.bottom = -rawBottom
|
||||
}
|
||||
|
||||
func configureContextMenuInteraction() {
|
||||
if isFullScreenAvailable {
|
||||
if navigationController?.isNavigationBarHidden ?? false {
|
||||
|
||||
Reference in new issue
Block a user