mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Restore feed selection after initial layout so that the visible area tests are correct.
This commit is contained in:
@@ -27,6 +27,7 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner {
|
||||
return keyboardManager.keyCommands
|
||||
}
|
||||
|
||||
var restoreSelection = false
|
||||
override var canBecomeFirstResponder: Bool {
|
||||
return true
|
||||
}
|
||||
@@ -75,6 +76,17 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner {
|
||||
super.viewWillAppear(animated)
|
||||
}
|
||||
|
||||
override func viewDidLayoutSubviews() {
|
||||
super.viewDidLayoutSubviews()
|
||||
|
||||
// We have to delay the selection of the Feed until the subviews have been layed out
|
||||
// so that the visible area is correct and we scroll correctly.
|
||||
if restoreSelection {
|
||||
restoreSelectionIfNecessary(adjustScroll: true)
|
||||
restoreSelection = false
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Notifications
|
||||
|
||||
@objc func unreadCountDidChange(_ note: Notification) {
|
||||
|
||||
@@ -1829,7 +1829,9 @@ private extension SceneCoordinator {
|
||||
}
|
||||
|
||||
treeControllerDelegate.addFilterException(feedIdentifier)
|
||||
masterFeedViewController.restoreSelection = true
|
||||
|
||||
|
||||
switch feedIdentifier {
|
||||
|
||||
case .smartFeed:
|
||||
@@ -1902,6 +1904,8 @@ private extension SceneCoordinator {
|
||||
return false
|
||||
}
|
||||
|
||||
masterFeedViewController.restoreSelection = true
|
||||
|
||||
switch feedIdentifier {
|
||||
|
||||
case .smartFeed:
|
||||
|
||||
Reference in New Issue
Block a user