-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathSuggestionSettingsGeneralSectionView.swift
More file actions
49 lines (42 loc) · 1.42 KB
/
SuggestionSettingsGeneralSectionView.swift
File metadata and controls
49 lines (42 loc) · 1.42 KB
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
import Client
import Preferences
import SharedUIComponents
import SwiftUI
import XPCShared
struct SuggestionSettingsGeneralSectionView: View {
final class Settings: ObservableObject {
@AppStorage(\.realtimeSuggestionToggle)
var realtimeSuggestionToggle
@AppStorage(\.suggestionFeatureEnabledProjectList)
var suggestionFeatureEnabledProjectList
@AppStorage(\.acceptSuggestionWithTab)
var acceptSuggestionWithTab
}
@StateObject var settings = Settings()
@State var isSuggestionFeatureDisabledLanguageListViewOpen = false
var body: some View {
Form {
Toggle(isOn: $settings.realtimeSuggestionToggle) {
Text("Request suggestions in real-time")
}
Toggle(isOn: $settings.acceptSuggestionWithTab) {
HStack {
Text("Accept suggestions with Tab")
}
}
HStack {
Button("Disabled language list") {
isSuggestionFeatureDisabledLanguageListViewOpen = true
}
}.sheet(isPresented: $isSuggestionFeatureDisabledLanguageListViewOpen) {
SuggestionFeatureDisabledLanguageListView(
isOpen: $isSuggestionFeatureDisabledLanguageListViewOpen
)
}
}
}
}
#Preview {
SuggestionSettingsGeneralSectionView()
.padding()
}