blob: 8db6002455d653939bc2a12c46a4093467e4dce9 (
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
|
import SwiftUI
struct SettingsSectionDetailsView: View {
@EnvironmentObject var settings: SettingsManager
var body: some View {
Form {
Section("Image Quality") {
Picker("Image Quality", selection: $settings.detailViewQuality) {
ForEach(BooruPostFileType.allCases, id: \.self) { type in
Text(type.rawValue.capitalized).tag(type)
}
}
}
Section("Appearance") {
Toggle("Show Share Action", isOn: $settings.enableShareShortcut)
Toggle("Show Information Bar", isOn: $settings.displayDetailsInformationBar)
}
#if os(macOS)
Section("Saved Files") {
Toggle(isOn: $settings.saveTagsToFile) {
Text("Save Tags Alongside Images")
Text("Saves post tags in a file alongside the downloaded image.")
}
}
#endif
Section("Loading") {
let preloadRange = 0...10
#if os(macOS)
Picker("Preload Nearby Images", selection: $settings.preloadedCarouselImages) {
ForEach(preloadRange, id: \.self) { columns in Text("\(columns)") }
}
#else
Stepper(
"Preload Nearby Images: \(settings.preloadedCarouselImages)",
value: $settings.preloadedCarouselImages,
in: preloadRange
)
#endif
}
}
#if os(macOS)
.formStyle(.grouped)
#endif
.navigationTitle("Viewer")
#if !os(macOS)
.navigationBarTitleDisplayMode(.large)
#endif
}
}
#Preview {
NavigationStack {
SettingsSectionDetailsView()
.environmentObject(SettingsManager())
}
}
|