mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Disable Reader View
This commit: - adds a `isFeedProvider: Bool` property to `WebFeed` - if `isFeedProvider` is `true`, the article extractor is disabled on the inspector, hidden from the context menu, and the toolbar button is disabled. Additionally, if `isFeedProvider` is `true`, `isArticleExtractorAlwaysOn` returns `false` and cannot be set to `true`.
This commit is contained in:
@@ -1061,6 +1061,7 @@ private extension MainWindowController {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
if #available(macOS 11.0, *) {
|
||||
|
||||
guard let toolbarItem = item as? NSToolbarItem, let toolbarButton = toolbarItem.view as? ArticleExtractorButton else {
|
||||
@@ -1069,6 +1070,15 @@ private extension MainWindowController {
|
||||
}
|
||||
return currentLink != nil
|
||||
}
|
||||
|
||||
if let webfeed = currentTimelineViewController?.selectedArticles.first?.webFeed {
|
||||
if webfeed.isFeedProvider {
|
||||
toolbarButton.isEnabled = false
|
||||
return false
|
||||
} else {
|
||||
toolbarButton.isEnabled = true
|
||||
}
|
||||
}
|
||||
|
||||
guard let state = articleExtractor?.state else {
|
||||
toolbarButton.buttonState = .off
|
||||
@@ -1093,6 +1103,15 @@ private extension MainWindowController {
|
||||
return currentLink != nil
|
||||
}
|
||||
|
||||
if let webfeed = currentTimelineViewController?.selectedArticles.first?.webFeed {
|
||||
if webfeed.isFeedProvider {
|
||||
toolbarButton.isEnabled = false
|
||||
return false
|
||||
} else {
|
||||
toolbarButton.isEnabled = true
|
||||
}
|
||||
}
|
||||
|
||||
toolbarButton.state = isShowingExtractedArticle ? .on : .off
|
||||
|
||||
guard let state = articleExtractor?.state else {
|
||||
|
||||
Reference in New Issue
Block a user