aboutsummaryrefslogtreecommitdiff
path: root/Captura/Presentation/Settings
diff options
context:
space:
mode:
authorRuben Beltran del Rio <ruben@unlimited.pizza>2023-07-27 22:32:10 +0200
committerRuben Beltran del Rio <ruben@unlimited.pizza>2023-07-27 22:32:10 +0200
commita4e804275517af683afa1733e2db7c383c306f2b (patch)
tree643eff7b3648aad15ce569eec0e1d7c9abddc00d /Captura/Presentation/Settings
parente834022c9b363804d36045892a305204f2019216 (diff)
Use framerate, control stop
Diffstat (limited to 'Captura/Presentation/Settings')
-rw-r--r--Captura/Presentation/Settings/AdvancedSettings.swift32
-rw-r--r--Captura/Presentation/Settings/OutputSettings.swift42
2 files changed, 74 insertions, 0 deletions
diff --git a/Captura/Presentation/Settings/AdvancedSettings.swift b/Captura/Presentation/Settings/AdvancedSettings.swift
new file mode 100644
index 0000000..7ed78d9
--- /dev/null
+++ b/Captura/Presentation/Settings/AdvancedSettings.swift
@@ -0,0 +1,32 @@
+import SwiftUI
+
+struct AdvancedSettings: View {
+
+ @AppStorage("backendUrl") var backendUrl: String = ""
+ @AppStorage("keepFiles") var keepFiles = true
+
+ var body: some View {
+ Form {
+ VStack (alignment: .leading) {
+ LabeledContent("Backend URL") {
+ TextField("", text: $backendUrl)
+ }.font(.headline)
+ LabeledContent("Keep files after remote upload") {
+ Toggle("", isOn: $keepFiles)
+ }.font(.headline)
+ HStack {
+ Text("These settings can break things!")
+ Button {
+ print("Not yet!")
+ } label: {
+ Image(systemName: "info.circle")
+ }.buttonStyle(.borderless)
+ }
+ }
+ }
+ }
+}
+
+#Preview {
+ OutputSettings()
+}
diff --git a/Captura/Presentation/Settings/OutputSettings.swift b/Captura/Presentation/Settings/OutputSettings.swift
new file mode 100644
index 0000000..3b8e01c
--- /dev/null
+++ b/Captura/Presentation/Settings/OutputSettings.swift
@@ -0,0 +1,42 @@
+import SwiftUI
+
+struct OutputSettings: View {
+
+ @AppStorage("outputFormats") var outputFormats: OutputFormatSetting = .all
+ @AppStorage("frameRate") var frameRate = 10.0
+
+ var body: some View {
+ Form {
+ VStack (alignment: .leading) {
+ LabeledContent("GIF Framerate") {
+ Slider(value: $frameRate, in: 4...10, step: 1) {
+ Text("\(Int(frameRate))").font(.body).frame(width: 24)
+ } minimumValueLabel: {
+ Text("4")
+ } maximumValueLabel: {
+ Text("12")
+ }
+ }.font(.headline)
+ Picker(selection: $outputFormats, label: Text("Output Formats").font(.headline)) {
+ Text("GIF & MP4")
+ .tag(OutputFormatSetting.all)
+ .padding(.horizontal, 4.0)
+ .padding(.vertical, 2.0)
+ Text("Only GIF")
+ .tag(OutputFormatSetting.gifOnly)
+ .padding(.horizontal, 4.0)
+ .padding(.vertical, 2.0)
+
+ Text("Only MP4")
+ .tag(OutputFormatSetting.mp4Only)
+ .padding(.horizontal, 4.0)
+ .padding(.vertical, 2.0)
+ }.pickerStyle(.radioGroup)
+ }
+ }
+ }
+}
+
+#Preview {
+ OutputSettings()
+}