summaryrefslogtreecommitdiff
path: root/Sora/Views/Settings/Section/SettingsSectionDetailsView.swift
diff options
context:
space:
mode:
Diffstat (limited to 'Sora/Views/Settings/Section/SettingsSectionDetailsView.swift')
-rw-r--r--Sora/Views/Settings/Section/SettingsSectionDetailsView.swift63
1 files changed, 63 insertions, 0 deletions
diff --git a/Sora/Views/Settings/Section/SettingsSectionDetailsView.swift b/Sora/Views/Settings/Section/SettingsSectionDetailsView.swift
new file mode 100644
index 0000000..9634297
--- /dev/null
+++ b/Sora/Views/Settings/Section/SettingsSectionDetailsView.swift
@@ -0,0 +1,63 @@
+import SwiftUI
+
+struct SettingsSectionDetailsView: View {
+ @EnvironmentObject var settings: SettingsManager
+
+ var body: some View {
+ Form {
+ Section(header: Text("Image Quality")) {
+ Picker("Image Quality", selection: $settings.detailViewQuality) {
+ ForEach(BooruPostFileType.allCases, id: \.self) { type in
+ Text(type.rawValue.capitalized).tag(type)
+ }
+ }
+ }
+
+ Section(header: Text("Display Options")) {
+ Toggle("Enable \"Share Image\" Shortcut", isOn: $settings.enableShareShortcut)
+
+ Toggle("Display Information Bar", isOn: $settings.displayDetailsInformationBar)
+ }
+
+ #if os(macOS)
+ Section(header: Text("File Management")) {
+ Toggle(isOn: $settings.saveTagsToFile) {
+ Text("Save Tags to File")
+
+ Text("Saves post tags in a file alongside the downloaded image.")
+ }
+ }
+ #endif
+
+ Section(header: Text("Performance")) {
+ let preloadRange = 0...10
+
+ #if os(macOS)
+ Picker("Preloaded Images", selection: $settings.preloadedCarouselImages) {
+ ForEach(preloadRange, id: \.self) { columns in Text("\(columns)") }
+ }
+ #else
+ Stepper(
+ "Preloaded Images: \(settings.preloadedCarouselImages)",
+ value: $settings.preloadedCarouselImages,
+ in: preloadRange
+ )
+ #endif
+ }
+ }
+ #if os(macOS)
+ .formStyle(.grouped)
+ #endif
+ .navigationTitle("Details")
+ #if !os(macOS)
+ .navigationBarTitleDisplayMode(.large)
+ #endif
+ }
+}
+
+#Preview {
+ NavigationStack {
+ SettingsSectionDetailsView()
+ .environmentObject(SettingsManager())
+ }
+}