mirror of
https://github.com/maxgoedjen/secretive.git
synced 2026-11-19 03:55:59 +01:00
Add settings for batch auth handling. (#870)
This commit is contained in:
1 parent
164aacc94e
commit
56c2f841ed
10 files changed
+191
-20
No files matched your search
@@ -3,12 +3,50 @@ import SettingsKit
|
||||
|
||||
struct SettingsView: View {
|
||||
|
||||
enum TabID {
|
||||
case general
|
||||
case agent
|
||||
}
|
||||
|
||||
@Environment(\.settingsStore) var settingsStore
|
||||
@State var selection: TabID = .agent
|
||||
|
||||
var body: some View {
|
||||
Form {
|
||||
@Bindable var settingsStore = settingsStore
|
||||
NavigationSplitView {
|
||||
List(selection: $selection) {
|
||||
NavigationLink(.settingsAgentTabTitle, value: TabID.agent)
|
||||
}
|
||||
.toolbar(removing: .sidebarToggle)
|
||||
} detail: {
|
||||
switch selection {
|
||||
case .general:
|
||||
// Placeholder
|
||||
EmptyView()
|
||||
case .agent:
|
||||
Form {
|
||||
Section(.settingsMultipleAuthenticationSectionTitle) {
|
||||
Toggle(isOn: $settingsStore.multipleRequestScreenEnabled) {
|
||||
Text(.settingsMultipleAuthenticationEnabledLabel)
|
||||
}
|
||||
Group {
|
||||
Toggle(isOn: $settingsStore.showDockItemWithPendingRequestsScreen) {
|
||||
Text(.settingsMultipleAuthenticationShowsDockIconLabel)
|
||||
}
|
||||
// Value binding here is a hack to get around annoying Stepper behavior where it
|
||||
// won't draw the number of any non-floating point value (ie, ints)
|
||||
Stepper(.settingsMultipleAuthenticationThresholdLabel, value: .init(get: {
|
||||
Double(settingsStore.multipleRequestScreenCountThreshold)
|
||||
}, set: { newValue in
|
||||
settingsStore.multipleRequestScreenCountThreshold = Int(newValue)
|
||||
}), in: 2...100, format: .number)
|
||||
}
|
||||
.disabled(!settingsStore.multipleRequestScreenEnabled)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
.formStyle(.grouped)
|
||||
.frame(minWidth: 480, minHeight: 320)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user