mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Adds Mark As Read on Scroll to SwiftUI views.
This commit is contained in:
@@ -273,6 +273,7 @@ final class AppDefaults: ObservableObject {
|
||||
}
|
||||
set {
|
||||
AppDefaults.setBool(for: Key.markArticlesAsReadOnScroll, newValue)
|
||||
AppDefaults.shared.objectWillChange.send()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ struct DisplayAndBehaviorsView: View {
|
||||
Section(header: Text("Timeline", comment: "Display & Behaviours: Timeline section header")) {
|
||||
SettingsViewRows.sortOldestToNewest($appDefaults.timelineSortDirectionBool)
|
||||
SettingsViewRows.groupByFeed($appDefaults.timelineGroupByFeed)
|
||||
SettingsViewRows.markAsReadOnScroll($appDefaults.markArticlesAsReadOnScroll)
|
||||
SettingsViewRows.refreshToClearReadArticles($appDefaults.refreshClearsReadArticles)
|
||||
SettingsViewRows.timelineLayout
|
||||
}
|
||||
|
||||
@@ -61,6 +61,16 @@ struct SettingsViewRows {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Toggle for determining if articles are marked as read when scrolling the timeline view.
|
||||
/// - Parameter preference: `Binding<Bool>`
|
||||
/// - Returns: `some View`
|
||||
static func markAsReadOnScroll(_ preference: Binding<Bool>) -> some View {
|
||||
Toggle(isOn: preference) {
|
||||
Text("Mark As Read on Scroll", comment: "Mark As Read on Scroll")
|
||||
}
|
||||
}
|
||||
|
||||
/// This row, when tapped, will push the the Manage Extension screen
|
||||
/// in to view.
|
||||
static var manageExtensions: some View {
|
||||
|
||||
Reference in New Issue
Block a user