IceCubes/IceCubesApp/App/Tabs/Settings/HapticSettingsView.swift

31 lines
907 B
Swift
Raw Normal View History

2023-02-04 17:38:48 +01:00
import DesignSystem
import Env
import Models
2024-01-06 19:27:26 +01:00
import StatusKit
2023-02-04 17:38:48 +01:00
import SwiftUI
2023-09-19 09:18:20 +02:00
@MainActor
2023-02-04 17:38:48 +01:00
struct HapticSettingsView: View {
2023-09-18 21:03:52 +02:00
@Environment(Theme.self) private var theme
2023-09-19 09:18:20 +02:00
@Environment(UserPreferences.self) private var userPreferences
2023-02-04 17:38:48 +01:00
var body: some View {
2023-09-19 09:18:20 +02:00
@Bindable var userPreferences = userPreferences
2023-02-04 17:38:48 +01:00
Form {
Section {
Toggle("settings.haptic.timeline", isOn: $userPreferences.hapticTimelineEnabled)
Toggle("settings.haptic.tab-selection", isOn: $userPreferences.hapticTabSelectionEnabled)
Toggle("settings.haptic.buttons", isOn: $userPreferences.hapticButtonPressEnabled)
}
#if !os(visionOS)
2023-02-04 17:38:48 +01:00
.listRowBackground(theme.primaryBackgroundColor)
#endif
2023-02-04 17:38:48 +01:00
}
.navigationTitle("settings.haptic.navigation-title")
#if !os(visionOS)
2024-02-14 12:48:14 +01:00
.scrollContentBackground(.hidden)
.background(theme.secondaryBackgroundColor)
#endif
2023-02-04 17:38:48 +01:00
}
}