mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Converts AppDefaults to singleton
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// GeneralPreferencesView.swift
|
||||
// macOS
|
||||
//
|
||||
// Created by Stuart Breckenridge on 27/6/20.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct GeneralPreferencesView: View {
|
||||
|
||||
@EnvironmentObject private var defaults: AppDefaults
|
||||
|
||||
var body: some View {
|
||||
VStack {
|
||||
Form {
|
||||
Picker("Refresh Feeds",
|
||||
selection: $defaults.interval,
|
||||
content: {
|
||||
ForEach(RefreshInterval.allCases, content: { interval in
|
||||
Text(interval.description()).tag(interval.rawValue)
|
||||
})
|
||||
}).frame(width: 300, alignment: .center)
|
||||
|
||||
Toggle("Open webpages in background in browser", isOn: $defaults.openInBrowserInBackground)
|
||||
|
||||
Toggle("Hide Unread Count in Dock", isOn: $defaults.hideDockUnreadCount)
|
||||
}
|
||||
Spacer()
|
||||
}.frame(width: 300, alignment: .center)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user