summaryrefslogtreecommitdiff
path: root/Sora/Views/Settings/SettingsThumbnailsView.swift
blob: 04b4afba0f524692f3de8b9f82d04b6b98b623bc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import SwiftUI

struct SettingsThumbnailsView: View {
    @EnvironmentObject var settings: Settings

    var body: some View {
        #if os(macOS)
            Text("Thumbnails")
                .font(.headline)

            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

        #if os(macOS)
            HStack {
                Text("Blur Unsafe Thumbnails")

                Spacer()

                Toggle("", isOn: $settings.blurUnsafeThumbnails)
            }
        #else
            Toggle("Blur Unsafe Thumbnails", isOn: $settings.blurUnsafeThumbnails)
        #endif
    }
}