summaryrefslogtreecommitdiff
path: root/Sora/Views/Settings/Section/SettingsDetailsView.swift
blob: 3866994f707d5f9d902b476fed06babe802d648a (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
import SwiftUI

struct SettingsDetailsView: View {
  @EnvironmentObject var settings: SettingsManager

  var body: some View {
    Picker("Image Quality", selection: $settings.detailViewQuality) {
      ForEach(BooruPostFileType.allCases, id: \.self) { type in
        Text(type.rawValue.capitalized).tag(type)
      }
    }

    Toggle("Enable \"Share Image\" Shortcut", isOn: $settings.enableShareShortcut)

    Toggle("Display Information Bar", isOn: $settings.displayDetailsInformationBar)

    #if os(macOS)
      Toggle(isOn: $settings.saveTagsToFile) {
        Text("Save Tags to File")

        Text("Saves post tags in a file alongside the downloaded image.")
      }
    #endif

    let preloadRange = 0...10

    #if os(macOS)
      Picker("Preloaded Images", selection: $settings.preloadedCarouselImages) {
        ForEach(preloadRange, id: \.self) { columns in Text("\(columns)") }
      }
    #else
      Stepper(
        "Preloaded Images: \(settings.preloadedCarouselImages)",
        value: $settings.preloadedCarouselImages,
        in: preloadRange
      )
    #endif
  }
}