mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Add Feed Inspector
This commit is contained in:
@@ -46,6 +46,8 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(userDefaultsDidChange(_:)), name: UserDefaults.didChangeNotification, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(progressDidChange(_:)), name: .AccountRefreshProgressDidChange, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(contentSizeCategoryDidChange), name: UIContentSizeCategory.didChangeNotification, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(displayNameDidChange), name: .DisplayNameDidChange, object: nil)
|
||||
|
||||
|
||||
// Setup the Search Controller
|
||||
searchController.delegate = self
|
||||
@@ -129,6 +131,10 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
|
||||
coordinator.navigateToDetail()
|
||||
}
|
||||
|
||||
@objc func showFeedInspector(_ sender: UITapGestureRecognizer) {
|
||||
coordinator.showFeedInspector()
|
||||
}
|
||||
|
||||
// MARK: API
|
||||
|
||||
func restoreSelectionIfNecessary() {
|
||||
@@ -365,6 +371,10 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
|
||||
updateProgressIndicatorIfNeeded()
|
||||
}
|
||||
|
||||
@objc func displayNameDidChange(_ note: Notification) {
|
||||
titleView?.label.text = coordinator.timelineName
|
||||
}
|
||||
|
||||
// MARK: Reloading
|
||||
|
||||
func queueReloadAvailableCells() {
|
||||
@@ -454,12 +464,21 @@ private extension MasterTimelineViewController {
|
||||
}
|
||||
|
||||
func resetUI() {
|
||||
|
||||
title = coordinator.timelineName
|
||||
|
||||
if let titleView = Bundle.main.loadNibNamed("MasterTimelineTitleView", owner: self, options: nil)?[0] as? MasterTimelineTitleView {
|
||||
self.titleView = titleView
|
||||
titleView.imageView.image = coordinator.timelineFavicon
|
||||
titleView.label.text = coordinator.timelineName
|
||||
|
||||
if coordinator.timelineFetcher is Feed {
|
||||
let width = titleView.sizeThatFits(CGSize(width: CGFloat.greatestFiniteMagnitude, height: CGFloat.greatestFiniteMagnitude)).width
|
||||
titleView.widthAnchor.constraint(equalToConstant: width).isActive = true
|
||||
titleView.heightAnchor.constraint(equalToConstant: 44.0).isActive = true
|
||||
let tap = UITapGestureRecognizer(target: self, action:#selector(showFeedInspector(_:)))
|
||||
titleView.addGestureRecognizer(tap)
|
||||
}
|
||||
|
||||
navigationItem.titleView = titleView
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user