Adds Mac Preferences

This makes use of `@AppStorage` for preferences. Severeral more need to migrated from AppDefaults etc.
This commit is contained in:
Stuart Breckenridge
2020-06-29 21:04:50 +08:00
parent 2e6e934b6f
commit 1f6f5fa054
8 changed files with 506 additions and 55 deletions

View File

@@ -0,0 +1,33 @@
//
// GeneralPreferencesView.swift
// macOS
//
// Created by Stuart Breckenridge on 27/6/20.
//
import SwiftUI
struct GeneralPreferencesView: View {
@ObservedObject private var preferences = MacPreferences()
var body: some View {
VStack {
Form {
Picker("Refresh Feeds",
selection: $preferences.refreshFrequency,
content: {
ForEach(0..<preferences.refreshIntervals.count, content: {
Text(preferences.refreshIntervals[$0])
})
}).frame(width: 300, alignment: .center)
Toggle("Open webpages in background in browser", isOn: $preferences.openInBackground)
Toggle("Show Unread Count in Dock", isOn: $preferences.showUnreadCountInDock)
}
Spacer()
}.frame(width: 300, alignment: .center)
}
}