]> git.r.bdr.sh - rbdr/captura/blame - Captura/Presentation/Settings/OutputSettings.swift
Add AppleScript support
[rbdr/captura] / Captura / Presentation / Settings / OutputSettings.swift
CommitLineData
a4e80427 1import SwiftUI
377442f2 2import CloudStorage
a4e80427
RBR
3
4struct OutputSettings: View {
5
377442f2
RBR
6 @CloudStorage("outputFormats") var outputFormats: OutputFormatSetting = .all
7 @CloudStorage("frameRate") var frameRate = 10.0
8
9 private var anyState: String { "\(outputFormats), \(frameRate)" }
a4e80427
RBR
10
11 var body: some View {
12 Form {
c9b9e1d6 13 VStack (alignment: .center) {
a4e80427
RBR
14 LabeledContent("GIF Framerate") {
15 Slider(value: $frameRate, in: 4...10, step: 1) {
16 Text("\(Int(frameRate))").font(.body).frame(width: 24)
17 } minimumValueLabel: {
18 Text("4")
19 } maximumValueLabel: {
c9b9e1d6 20 Text("10")
a4e80427
RBR
21 }
22 }.font(.headline)
23 Picker(selection: $outputFormats, label: Text("Output Formats").font(.headline)) {
24 Text("GIF & MP4")
25 .tag(OutputFormatSetting.all)
26 .padding(.horizontal, 4.0)
27 .padding(.vertical, 2.0)
28 Text("Only GIF")
29 .tag(OutputFormatSetting.gifOnly)
30 .padding(.horizontal, 4.0)
31 .padding(.vertical, 2.0)
32
33 Text("Only MP4")
34 .tag(OutputFormatSetting.mp4Only)
35 .padding(.horizontal, 4.0)
36 .padding(.vertical, 2.0)
37 }.pickerStyle(.radioGroup)
38 }
c9b9e1d6 39 Spacer()
a4e80427 40 }
377442f2
RBR
41 .onChange(of: anyState) { _ in
42 NotificationCenter.default.post(name: .reloadConfiguration, object: nil, userInfo: nil)
43 }
a4e80427
RBR
44 }
45}
46
47#Preview {
48 OutputSettings()
49}