-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// | ||
// GeneralSettingsView.swift | ||
// DLPrototype | ||
// | ||
// Created by Ryan Priebe on 2023-01-02. | ||
// Copyright © 2023 YegCollective. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import SwiftUI | ||
|
||
struct GeneralSettings: View { | ||
@AppStorage("tigerStriped") private var tigerStriped: Bool = false | ||
@AppStorage("defaultTableSortOrder") private var defaultTableSortOrder: String = "DESC" | ||
@AppStorage("showExperimentalFeatures") private var showExperimentalFeatures: Bool = false | ||
@AppStorage("showExperiment.actions") private var showExperimentActions: Bool = false | ||
@AppStorage("enableAutoCorrection") public var enableAutoCorrection: Bool = false | ||
@AppStorage("autoFixJobs") public var autoFixJobs: Bool = false | ||
@AppStorage("defaultHome") public var defaultHome: Int = 0 | ||
|
||
var body: some View { | ||
Form { | ||
Toggle("Tiger stripe table rows", isOn: $tigerStriped) | ||
Toggle("Auto-correct text in text boxes", isOn: $enableAutoCorrection) | ||
|
||
Group { | ||
Toggle("Experimental features (may tank performance)", isOn: $showExperimentalFeatures) | ||
|
||
if showExperimentalFeatures { | ||
Toggle("Show row actions", isOn: $showExperimentActions) | ||
Toggle("Auto-fix records with bad jobs", isOn: $autoFixJobs) | ||
} | ||
} | ||
|
||
Picker("Default table sort direction:", selection: $defaultTableSortOrder) { | ||
Text("DESC").tag("DESC") | ||
Text("ASC").tag("ASC") | ||
} | ||
|
||
Picker("Default home screen:", selection: $defaultHome) { | ||
Text("Find").tag(0) | ||
Text("Today").tag(1) | ||
Text("Notes").tag(2) | ||
Text("Tasks").tag(3) | ||
Text("Projects").tag(4) | ||
Text("Job").tag(5) | ||
} | ||
} | ||
.padding(20) | ||
} | ||
} | ||
|
||
struct GeneralSettingsPreview: PreviewProvider { | ||
static var previews: some View { | ||
GeneralSettings() | ||
} | ||
} |