diff options
Diffstat (limited to 'Sora/Views/Settings/SettingsThumbnailsView.swift')
| -rw-r--r-- | Sora/Views/Settings/SettingsThumbnailsView.swift | 69 |
1 files changed, 69 insertions, 0 deletions
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 + } +} |