mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-01-30 02:34:55 +01:00
Fix the display mode button transitions between three panel mode and regular mode
This commit is contained in:
parent
93f6debae6
commit
35226b4af9
@ -1528,19 +1528,21 @@ private extension SceneCoordinator {
|
|||||||
// system, we leave the same controller, the shim, in place and change its child controllers instead.
|
// system, we leave the same controller, the shim, in place and change its child controllers instead.
|
||||||
|
|
||||||
func installDetailController(_ detailController: UIViewController, automated: Bool) {
|
func installDetailController(_ detailController: UIViewController, automated: Bool) {
|
||||||
let showButton = rootSplitViewController.displayMode != .allVisible
|
|
||||||
let controller = addNavControllerIfNecessary(detailController, showButton: showButton)
|
|
||||||
|
|
||||||
if isThreePanelMode {
|
if isThreePanelMode {
|
||||||
|
let controller = addNavControllerIfNecessary(detailController, showButton: false)
|
||||||
let targetSplit = ensureDoubleSplit().children.first as! UISplitViewController
|
let targetSplit = ensureDoubleSplit().children.first as! UISplitViewController
|
||||||
targetSplit.showDetailViewController(controller, sender: self)
|
targetSplit.showDetailViewController(controller, sender: self)
|
||||||
} else if rootSplitViewController.isCollapsed {
|
} else if rootSplitViewController.isCollapsed {
|
||||||
|
let controller = addNavControllerIfNecessary(detailController, showButton: false)
|
||||||
masterNavigationController.pushViewController(controller, animated: !automated)
|
masterNavigationController.pushViewController(controller, animated: !automated)
|
||||||
} else {
|
} else {
|
||||||
|
let controller = addNavControllerIfNecessary(detailController, showButton: true)
|
||||||
if let shimController = rootSplitViewController.viewControllers.last {
|
if let shimController = rootSplitViewController.viewControllers.last {
|
||||||
shimController.replaceChildAndPinView(controller)
|
shimController.replaceChildAndPinView(controller)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func addNavControllerIfNecessary(_ controller: UIViewController, showButton: Bool) -> UIViewController {
|
func addNavControllerIfNecessary(_ controller: UIViewController, showButton: Bool) -> UIViewController {
|
||||||
@ -1552,6 +1554,9 @@ private extension SceneCoordinator {
|
|||||||
if showButton {
|
if showButton {
|
||||||
controller.navigationItem.leftBarButtonItem = rootSplitViewController.displayModeButtonItem
|
controller.navigationItem.leftBarButtonItem = rootSplitViewController.displayModeButtonItem
|
||||||
controller.navigationItem.leftItemsSupplementBackButton = true
|
controller.navigationItem.leftItemsSupplementBackButton = true
|
||||||
|
} else {
|
||||||
|
controller.navigationItem.leftBarButtonItem = nil
|
||||||
|
controller.navigationItem.leftItemsSupplementBackButton = false
|
||||||
}
|
}
|
||||||
return navController
|
return navController
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user