Create BearWave macOS radio-first app
This commit is contained in:
38
Sources/BearWaveCore/Views/SettingsView.swift
Normal file
38
Sources/BearWaveCore/Views/SettingsView.swift
Normal file
@@ -0,0 +1,38 @@
|
||||
import SwiftUI
|
||||
|
||||
public struct SettingsView: View {
|
||||
@Environment(AppModel.self) private var model
|
||||
|
||||
public init() {}
|
||||
|
||||
public var body: some View {
|
||||
Form {
|
||||
Section("Radio Browser") {
|
||||
TextField("Base URL", text: Binding(
|
||||
get: { model.settings.radioBrowserBaseURL },
|
||||
set: {
|
||||
model.settings.radioBrowserBaseURL = $0
|
||||
model.applySettings()
|
||||
}
|
||||
))
|
||||
.textFieldStyle(.roundedBorder)
|
||||
}
|
||||
|
||||
Section("Playback") {
|
||||
Toggle("Resume last station on launch", isOn: Binding(
|
||||
get: { model.settings.resumeOnLaunch },
|
||||
set: { model.settings.resumeOnLaunch = $0 }
|
||||
))
|
||||
}
|
||||
|
||||
Section("Menu Bar") {
|
||||
Toggle("Show playback details in menu bar", isOn: Binding(
|
||||
get: { model.settings.showMenuBarExtraDetails },
|
||||
set: { model.settings.showMenuBarExtraDetails = $0 }
|
||||
))
|
||||
}
|
||||
}
|
||||
.formStyle(.grouped)
|
||||
.padding(20)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user