2020-07-12 21:37:27 +08:00

44 lines
1.1 KiB
Swift

//
// GeneralPreferencesView.swift
// macOS
//
// Created by Stuart Breckenridge on 27/6/20.
//
import SwiftUI
struct GeneralPreferencesView: View {
@EnvironmentObject private var defaults: AppDefaults
@ObservedObject var preferences: MacPreferencesModel
var body: some View {
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)
Picker("Default RSS reader", selection: $preferences.readerSelection, content: {
ForEach(0..<preferences.rssReaders.count, content: { index in
Text(preferences.rssReaders[index].nameMinusAppSuffix)
.tag(index)
})
})
Toggle("Open webpages in background in browser", isOn: $defaults.openInBrowserInBackground)
Toggle("Hide Unread Count in Dock", isOn: $defaults.hideDockUnreadCount)
}
.frame(width: 400, alignment: .center)
.lineLimit(2)
}
}