diff --git a/OnCue.xcodeproj/project.pbxproj b/OnCue.xcodeproj/project.pbxproj index a872000..a7c1e73 100644 --- a/OnCue.xcodeproj/project.pbxproj +++ b/OnCue.xcodeproj/project.pbxproj @@ -32,6 +32,8 @@ 46AD30F82C2689B900486C25 /* ProjectSlideshowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46AD30F72C2689B900486C25 /* ProjectSlideshowView.swift */; }; 46D3E13F2C26D6430060722E /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46D3E13E2C26D6430060722E /* Constants.swift */; }; 46D3E1402C26D6430060722E /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46D3E13E2C26D6430060722E /* Constants.swift */; }; + 46D3E1422C27DD5D0060722E /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46D3E1412C27DD5C0060722E /* SettingsView.swift */; }; + 46D3E1442C27DFCE0060722E /* Preferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46D3E1432C27DFCE0060722E /* Preferences.swift */; }; 46E5FFD92C26A50D001191C9 /* CueCardViewPresenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 46E5FFD82C26A50D001191C9 /* CueCardViewPresenter.swift */; }; /* End PBXBuildFile section */ @@ -81,6 +83,8 @@ 46AD30F52C26823B00486C25 /* AddNewCardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddNewCardView.swift; sourceTree = ""; }; 46AD30F72C2689B900486C25 /* ProjectSlideshowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProjectSlideshowView.swift; sourceTree = ""; }; 46D3E13E2C26D6430060722E /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = ""; }; + 46D3E1412C27DD5C0060722E /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = ""; }; + 46D3E1432C27DFCE0060722E /* Preferences.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Preferences.swift; sourceTree = ""; }; 46E5FFD82C26A50D001191C9 /* CueCardViewPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CueCardViewPresenter.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -180,6 +184,7 @@ 46AD30F52C26823B00486C25 /* AddNewCardView.swift */, 46AD30F72C2689B900486C25 /* ProjectSlideshowView.swift */, 464787CA2C269CAF00A9C462 /* TeleprompterView.swift */, + 46D3E1412C27DD5C0060722E /* SettingsView.swift */, ); path = View; sourceTree = ""; @@ -206,6 +211,7 @@ 46AD30F12C2672BD00486C25 /* ColorModel.swift */, 46AD30F32C267D6400486C25 /* PreviewData.swift */, 46D3E13E2C26D6430060722E /* Constants.swift */, + 46D3E1432C27DFCE0060722E /* Preferences.swift */, ); path = Shared; sourceTree = ""; @@ -319,7 +325,9 @@ 46AD30ED2C266C0B00486C25 /* CardsView.swift in Sources */, 46AD30BD2C26557500486C25 /* MainView.swift in Sources */, 46AD30F22C2672BD00486C25 /* ColorModel.swift in Sources */, + 46D3E1422C27DD5D0060722E /* SettingsView.swift in Sources */, 46D3E13F2C26D6430060722E /* Constants.swift in Sources */, + 46D3E1442C27DFCE0060722E /* Preferences.swift in Sources */, 46AD30BF2C26557500486C25 /* Item.swift in Sources */, 46AD30F42C267D6400486C25 /* PreviewData.swift in Sources */, 46AD30BB2C26557500486C25 /* OnCueApp.swift in Sources */, diff --git a/OnCue/View/MainView.swift b/OnCue/View/MainView.swift index b6c0b14..6fc3c88 100644 --- a/OnCue/View/MainView.swift +++ b/OnCue/View/MainView.swift @@ -12,6 +12,7 @@ struct MainView: View { @Environment(\.modelContext) private var modelContext @Query private var items: [OCProject] + @State private var showSettingsView = false @State private var newProjectName = "" @State private var addNewProject = false @State private var filterColor = "" @@ -37,6 +38,12 @@ struct MainView: View { } .toolbar { +// ToolbarItem(placement: .topBarLeading) { +// Button(action: {showSettingsView.toggle()}) { +// Image(systemName: "gear") +// } +// +// } // ToolbarItem(placement: .topBarTrailing) { // Menu { // Picker(selection: $filterColor) { @@ -65,6 +72,9 @@ struct MainView: View { .sheet(isPresented: $addNewProject) { NewProjectForm(completionHandler: addItem) } + .sheet(isPresented: $showSettingsView) { + SettingsView() + } } private func addItem(name: String, color: String) { diff --git a/OnCue/View/SettingsView.swift b/OnCue/View/SettingsView.swift new file mode 100644 index 0000000..55258ab --- /dev/null +++ b/OnCue/View/SettingsView.swift @@ -0,0 +1,36 @@ +// +// SettingsView.swift +// OnCue +// +// Created by Pradyun Setti on 23/06/2024. +// + +import SwiftUI + +struct SettingsView: View { + @Environment(\.dismiss) var dismiss + +// @State private var teleprompterSeparator = "---" + @AppStorage(Preferences.teleprompterSeparator) var teleprompterSeparator: String = "---" + + var body: some View { + NavigationView { + List { + Section { + TextField(text: $teleprompterSeparator) { Text("Teleprompter Cuecard Separator") } + } header: { Text("Teleprompter View") } + } + .navigationTitle("Settings") + .navigationBarTitleDisplayMode(.inline) + .toolbar { + ToolbarItem(placement: .topBarTrailing) { + Button("Done") { dismiss() } + } + } + } + } +} + +#Preview { + SettingsView() +} diff --git a/Shared/Preferences.swift b/Shared/Preferences.swift new file mode 100644 index 0000000..a033436 --- /dev/null +++ b/Shared/Preferences.swift @@ -0,0 +1,12 @@ +// +// AppStorage.swift +// OnCue +// +// Created by Pradyun Setti on 23/06/2024. +// + +import Foundation + +public struct Preferences { + static let teleprompterSeparator = "teleprompterSeparator" +}