mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-12-05 19:57:31 +00:00
Add mark-read setting on iOS. Respect the mark-read-manually setting.
This commit is contained in:
1 parent
f60677a71a
commit
e47a247c7c
4 files changed
+46
-1
No files matched your search
@@ -891,6 +891,9 @@
|
||||
"Manually" : {
|
||||
"comment" : "Manually"
|
||||
},
|
||||
"Manually only" : {
|
||||
"comment" : "Mark as Read setting: articles are marked read only by the user"
|
||||
},
|
||||
"Mark Above as Read" : {
|
||||
"comment" : "Command"
|
||||
},
|
||||
@@ -1780,6 +1783,12 @@
|
||||
"Web accounts sync your feeds across all your devices." : {
|
||||
"comment" : "Web Account"
|
||||
},
|
||||
"When selected" : {
|
||||
"comment" : "Mark as Read setting: articles are marked read when selected"
|
||||
},
|
||||
"When selected or scrolled past" : {
|
||||
"comment" : "Mark as Read setting: articles are marked read when selected or when scrolled off the top of the timeline"
|
||||
},
|
||||
"You can enable NetNewsWire notifications in System Preferences." : {
|
||||
"comment" : "Notifications are not enabled."
|
||||
},
|
||||
|
||||
@@ -1252,7 +1252,9 @@ struct SidebarItemNode: Hashable, Sendable {
|
||||
mainTimelineViewController?.didPushArticleViewController = true
|
||||
|
||||
// Mark article as read before navigating to it, so the read status does not flash unread/read on display
|
||||
markArticles(Set([article!]), statusKey: .read, flag: true)
|
||||
if AppDefaults.markReadBehavior != .manual {
|
||||
markArticles(Set([article!]), statusKey: .read, flag: true)
|
||||
}
|
||||
|
||||
mainTimelineViewController?.updateArticleSelection(animations: animations)
|
||||
articleViewController?.article = article
|
||||
|
||||
@@ -26,6 +26,12 @@ struct GeneralSettingsView: View {
|
||||
}
|
||||
}
|
||||
.pickerStyle(.menu)
|
||||
Picker(String(localized: "Mark as Read", comment: "Command"), selection: Binding(get: { model.markReadBehavior }, set: { AppDefaults.markReadBehavior = $0 })) {
|
||||
ForEach(MarkReadBehavior.allCases, id: \.self) { markReadBehavior in
|
||||
Text(String(describing: markReadBehavior))
|
||||
}
|
||||
}
|
||||
.pickerStyle(.menu)
|
||||
Toggle(String(localized: "Grayscale Feed Icons", comment: "Grayscale Feed Icons"), isOn: Binding(get: { model.grayscaleIcons }, set: { AppDefaults.grayscaleIcons = $0 }))
|
||||
}
|
||||
.settingsAccentTint()
|
||||
@@ -38,11 +44,13 @@ struct GeneralSettingsView: View {
|
||||
|
||||
private(set) var colorPalette = AppDefaults.userInterfaceColorPalette
|
||||
private(set) var unreadCountDisplay = AppDefaults.unreadCountDisplay
|
||||
private(set) var markReadBehavior = AppDefaults.markReadBehavior
|
||||
private(set) var grayscaleIcons = AppDefaults.grayscaleIcons
|
||||
|
||||
init() {
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(handleUserInterfaceColorPaletteDidUpdate(_:)), name: .userInterfaceColorPaletteDidUpdate, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(handleUnreadCountDisplaySettingDidChange(_:)), name: .unreadCountDisplaySettingDidChange, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(handleMarkReadBehaviorDidChange(_:)), name: .markReadBehaviorDidChange, object: nil)
|
||||
NotificationCenter.default.addObserver(self, selector: #selector(handleGrayscaleIconsDidChange(_:)), name: .grayscaleIconsDidChange, object: nil)
|
||||
}
|
||||
|
||||
@@ -54,6 +62,10 @@ struct GeneralSettingsView: View {
|
||||
unreadCountDisplay = AppDefaults.unreadCountDisplay
|
||||
}
|
||||
|
||||
@objc func handleMarkReadBehaviorDidChange(_ notification: Notification) {
|
||||
markReadBehavior = AppDefaults.markReadBehavior
|
||||
}
|
||||
|
||||
@objc func handleGrayscaleIconsDidChange(_ notification: Notification) {
|
||||
grayscaleIcons = AppDefaults.grayscaleIcons
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// MarkReadBehavior+Description.swift
|
||||
// NetNewsWire
|
||||
//
|
||||
// Created by Brent Simmons on 12/5/26.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
extension MarkReadBehavior: CustomStringConvertible {
|
||||
|
||||
var description: String {
|
||||
switch self {
|
||||
case .manual:
|
||||
NSLocalizedString("Manually only", comment: "Mark as Read setting: articles are marked read only by the user")
|
||||
case .selection:
|
||||
NSLocalizedString("When selected", comment: "Mark as Read setting: articles are marked read when selected")
|
||||
case .selectionAndScrolledPast:
|
||||
NSLocalizedString("When selected or scrolled past", comment: "Mark as Read setting: articles are marked read when selected or when scrolled off the top of the timeline")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user