diff options
Diffstat (limited to 'Sora/Views/Settings')
| -rw-r--r-- | Sora/Views/Settings/SettingsDetailsView.swift | 31 | ||||
| -rw-r--r-- | Sora/Views/Settings/SettingsSearchView.swift | 22 | ||||
| -rw-r--r-- | Sora/Views/Settings/SettingsThumbnailsView.swift | 69 |
3 files changed, 122 insertions, 0 deletions
diff --git a/Sora/Views/Settings/SettingsDetailsView.swift b/Sora/Views/Settings/SettingsDetailsView.swift new file mode 100644 index 0000000..29b9e76 --- /dev/null +++ b/Sora/Views/Settings/SettingsDetailsView.swift @@ -0,0 +1,31 @@ +import SwiftUI + +struct SettingsDetailsView: View { + @EnvironmentObject var settings: Settings + + var body: some View { + #if os(macOS) + Text("Details") + .font(.headline) + + HStack { + Text("Detail View Type") + + Spacer() + + Picker("", selection: $settings.detailViewType) { + ForEach(PostFileType.allCases, id: \.self) { type in + Text(type.rawValue.capitalized).tag(type) + } + } + .frame(width: 150) + } + #else + Picker("Detail View Type", selection: $settings.detailViewType) { + ForEach(PostFileType.allCases, id: \.self) { type in + Text(type.rawValue.capitalized).tag(type) + } + } + #endif + } +} diff --git a/Sora/Views/Settings/SettingsSearchView.swift b/Sora/Views/Settings/SettingsSearchView.swift new file mode 100644 index 0000000..c1f1baa --- /dev/null +++ b/Sora/Views/Settings/SettingsSearchView.swift @@ -0,0 +1,22 @@ +import SwiftUI + +struct SettingsSearchView: View { + @EnvironmentObject var settings: Settings + + var body: some View { + #if os(macOS) + Text("Search") + .font(.headline) + + HStack { + Text("Suggest Search Tags") + + Spacer() + + Toggle("", isOn: $settings.searchSuggestions) + } + #else + Toggle("Suggest Search Tags", isOn: $settings.searchSuggestions) + #endif + } +} diff --git a/Sora/Views/Settings/SettingsThumbnailsView.swift b/Sora/Views/Settings/SettingsThumbnailsView.swift new file mode 100644 index 0000000..552ef0c --- /dev/null +++ b/Sora/Views/Settings/SettingsThumbnailsView.swift @@ -0,0 +1,69 @@ +import SwiftUI + +struct SettingsThumbnailsView: View { + @EnvironmentObject var settings: Settings + + var body: some View { + #if os(macOS) + Text("Thumbnails") + .font(.headline) + + HStack { + Text("Thumbnail Size") + + Spacer() + + TextField("", value: $settings.softLimit, format: .number) + .textFieldStyle(.roundedBorder) + .frame(width: 100) + } + #else + Stepper( + "Thumbnail Size (\(settings.softLimit))", + value: $settings.softLimit, + in: 100 ... 10000, + step: 10 + ) + #endif + + #if os(macOS) + HStack { + Text("Thumbnail Type") + + Spacer() + + Picker("", selection: $settings.thumbnailType) { + ForEach(PostFileType.allCases, id: \.self) { type in + Text(type.rawValue.capitalized).tag(type) + } + } + .frame(width: 150) + } + #else + Picker("Thumbnail Type", selection: $settings.thumbnailType) { + ForEach(PostFileType.allCases, id: \.self) { type in + Text(type.rawValue.capitalized).tag(type) + } + } + #endif + + #if os(macOS) + HStack { + Text("Thumbnail Columns") + + Spacer() + + Picker("", selection: $settings.columns) { + ForEach(1 ... 10, id: \.self) { i in Text("\(i)") } + } + .frame(width: 75) + } + #else + Stepper( + "Thumbnail Columns (\(settings.columns))", + value: $settings.columns, + in: 1 ... 10 + ) + #endif + } +} |