mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-19 21:13:22 +01:00
Reset focus when returning to the app from another app or the safari view controller. Issue #1963
This commit is contained in:
parent
6f29b21ddc
commit
31f3487d7a
@ -21,6 +21,10 @@ class RootSplitViewController: UISplitViewController {
|
||||
return .slide
|
||||
}
|
||||
|
||||
override func viewDidAppear(_ animated: Bool) {
|
||||
coordinator.resetFocus()
|
||||
}
|
||||
|
||||
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
|
||||
self.coordinator.configurePanelMode(for: size)
|
||||
super.viewWillTransition(to: size, with: coordinator)
|
||||
|
@ -405,6 +405,14 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
|
||||
wasRootSplitViewControllerCollapsed = rootSplitViewController.isCollapsed
|
||||
}
|
||||
|
||||
func resetFocus() {
|
||||
if currentArticle != nil {
|
||||
masterTimelineViewController?.focus()
|
||||
} else {
|
||||
masterFeedViewController?.focus()
|
||||
}
|
||||
}
|
||||
|
||||
func selectFirstUnreadInAllUnread() {
|
||||
markExpanded(SmartFeedsController.shared)
|
||||
self.ensureFeedIsAvailableToSelect(SmartFeedsController.shared.unreadFeed) {
|
||||
|
@ -66,7 +66,8 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
|
||||
func sceneWillEnterForeground(_ scene: UIScene) {
|
||||
appDelegate.resumeDatabaseProcessingIfNecessary()
|
||||
appDelegate.prepareAccountsForForeground()
|
||||
self.coordinator.configurePanelMode(for: window!.frame.size)
|
||||
coordinator.configurePanelMode(for: window!.frame.size)
|
||||
coordinator.resetFocus()
|
||||
}
|
||||
|
||||
func stateRestorationActivity(for scene: UIScene) -> NSUserActivity? {
|
||||
|
Loading…
Reference in New Issue
Block a user