|
|
|
|
@ -11,18 +11,30 @@ struct SettingsView: View { |
|
|
|
|
|
|
|
|
|
@State var confirmationSound = Preferences.playConfirmationSound |
|
|
|
|
@State var cancellationSound = Preferences.playCancellationSound |
|
|
|
|
@State var defaultVolume: Float = Preferences.defaultVolume |
|
|
|
|
|
|
|
|
|
@State var showMailView: Bool = false |
|
|
|
|
|
|
|
|
|
var body: some View { |
|
|
|
|
|
|
|
|
|
Form { |
|
|
|
|
Toggle("Play confirmation sound", isOn: self.$confirmationSound).onChange(of: self.confirmationSound) { newValue in |
|
|
|
|
Toggle("Play confirmation sound", isOn: self.$confirmationSound) |
|
|
|
|
.onChange(of: self.confirmationSound) { newValue in |
|
|
|
|
Preferences.playConfirmationSound = newValue |
|
|
|
|
} |
|
|
|
|
Toggle("Play cancellation sound", isOn: self.$cancellationSound).onChange(of: self.cancellationSound) { newValue in |
|
|
|
|
Toggle("Play cancellation sound", isOn: self.$cancellationSound) |
|
|
|
|
.onChange(of: self.cancellationSound) { newValue in |
|
|
|
|
Preferences.playCancellationSound = newValue |
|
|
|
|
} |
|
|
|
|
HStack { |
|
|
|
|
Text("Default Volume") |
|
|
|
|
Spacer() |
|
|
|
|
Slider(value: self.$defaultVolume) |
|
|
|
|
.onChange(of: self.defaultVolume, perform: { newValue in |
|
|
|
|
Preferences.defaultVolume = self.defaultVolume |
|
|
|
|
}) |
|
|
|
|
.frame(width: 120.0) |
|
|
|
|
} |
|
|
|
|
Button { |
|
|
|
|
self.showMailView = true |
|
|
|
|
} label: { |
|
|
|
|
|