blob: d5fe750ad8cde7749d332842f2ffb714f6c8f531 (
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
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("Show NSFW Posts")
Spacer()
Toggle("", isOn: $settings.showNSFWPosts)
}
#else
Toggle("Show NSFW Posts", isOn: $settings.showNSFWPosts)
#endif
if settings.showNSFWPosts {
#if os(macOS)
HStack {
Text("Blur NSFW Thumbnails")
Spacer()
Toggle("", isOn: $settings.blurNSFWThumbnails)
}
#else
Toggle("Blur NSFW Thumbnails", isOn: $settings.blurUnsafeThumbnails)
#endif
}
}
}
|