2020-07-12 08:07:52 +02:00
|
|
|
//
|
|
|
|
// GeneralPreferencesView.swift
|
|
|
|
// macOS
|
|
|
|
//
|
|
|
|
// Created by Stuart Breckenridge on 27/6/20.
|
|
|
|
//
|
|
|
|
|
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
struct GeneralPreferencesView: View {
|
|
|
|
|
2020-08-05 14:06:44 +02:00
|
|
|
@StateObject private var defaults = AppDefaults.shared
|
2020-07-15 04:54:18 +02:00
|
|
|
@StateObject private var preferences = GeneralPreferencesModel()
|
2020-07-12 08:07:52 +02:00
|
|
|
|
|
|
|
var body: some View {
|
2020-07-12 15:47:29 +02:00
|
|
|
Form {
|
|
|
|
Picker("Refresh feeds",
|
|
|
|
selection: $defaults.interval,
|
|
|
|
content: {
|
|
|
|
ForEach(RefreshInterval.allCases, content: { interval in
|
|
|
|
Text(interval.description())
|
|
|
|
.tag(interval.rawValue)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
Picker("Default RSS reader", selection: $preferences.readerSelection, content: {
|
|
|
|
ForEach(0..<preferences.rssReaders.count, content: { index in
|
|
|
|
if index > 0 && preferences.rssReaders[index].nameMinusAppSuffix.contains("NetNewsWire") {
|
|
|
|
Text(preferences.rssReaders[index].nameMinusAppSuffix.appending(" (old version)"))
|
|
|
|
|
|
|
|
} else {
|
2020-07-12 15:37:27 +02:00
|
|
|
Text(preferences.rssReaders[index].nameMinusAppSuffix)
|
|
|
|
.tag(index)
|
2020-07-12 15:47:29 +02:00
|
|
|
}
|
2020-07-12 12:53:37 +02:00
|
|
|
})
|
2020-07-12 15:47:29 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
Toggle("Open webpages in background in browser", isOn: $defaults.openInBrowserInBackground)
|
|
|
|
|
|
|
|
Toggle("Hide Unread Count in Dock", isOn: $defaults.hideDockUnreadCount)
|
2020-07-14 08:57:55 +02:00
|
|
|
|
2020-07-12 15:47:29 +02:00
|
|
|
}
|
|
|
|
.frame(width: 400, alignment: .center)
|
|
|
|
.lineLimit(2)
|
2020-07-12 08:07:52 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|