new tests
This commit is contained in:
+56
-26
@@ -167,36 +167,66 @@ struct WorkbenchSettingsView: View {
|
||||
@AppStorage("preferences.confirmDestructiveSQL") private var confirmDestructiveSQL = true
|
||||
|
||||
var body: some View {
|
||||
NavigationSplitView {
|
||||
List(SettingsSection.allCases, selection: $selectedSection) { section in
|
||||
Label(section.rawValue, systemImage: section.icon)
|
||||
.tag(section)
|
||||
.padding(.vertical, 3)
|
||||
}
|
||||
.listStyle(.sidebar)
|
||||
.navigationTitle("Settings")
|
||||
.frame(minWidth: 205)
|
||||
} detail: {
|
||||
Group {
|
||||
switch selectedSection ?? .general {
|
||||
case .general: generalSettings
|
||||
case .connections: connectionsSettings
|
||||
case .security: securitySettings
|
||||
case .editor: editorSettings
|
||||
case .execution: executionSettings
|
||||
case .results: resultSettings
|
||||
case .database: databaseSettings
|
||||
case .diagrams: diagramSettings
|
||||
case .laravel: migrationSettings
|
||||
case .administration: administrationSettings
|
||||
case .exports: exportSettings
|
||||
case .advanced: advancedSettings
|
||||
HStack(spacing: 0) {
|
||||
VStack(alignment: .leading, spacing: 4) {
|
||||
Text("DBSyn Settings")
|
||||
.font(.headline)
|
||||
.padding(.horizontal, 14)
|
||||
.padding(.top, 18)
|
||||
.padding(.bottom, 12)
|
||||
|
||||
ScrollView {
|
||||
VStack(alignment: .leading, spacing: 3) {
|
||||
ForEach(SettingsSection.allCases) { section in
|
||||
Button {
|
||||
selectedSection = section
|
||||
} label: {
|
||||
Label(section.rawValue, systemImage: section.icon)
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
.padding(.horizontal, 12)
|
||||
.padding(.vertical, 9)
|
||||
.background(
|
||||
(selectedSection ?? .general) == section
|
||||
? Color.accentColor.opacity(0.22)
|
||||
: Color.clear,
|
||||
in: RoundedRectangle(cornerRadius: 7)
|
||||
)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.accessibilityIdentifier("settings.section.\(section.id)")
|
||||
}
|
||||
}
|
||||
.padding(.horizontal, 10)
|
||||
}
|
||||
}
|
||||
.frame(width: 230)
|
||||
.frame(maxHeight: .infinity, alignment: .top)
|
||||
.background(Color(nsColor: .controlBackgroundColor))
|
||||
|
||||
Divider()
|
||||
|
||||
ScrollView {
|
||||
Group {
|
||||
switch selectedSection ?? .general {
|
||||
case .general: generalSettings
|
||||
case .connections: connectionsSettings
|
||||
case .security: securitySettings
|
||||
case .editor: editorSettings
|
||||
case .execution: executionSettings
|
||||
case .results: resultSettings
|
||||
case .database: databaseSettings
|
||||
case .diagrams: diagramSettings
|
||||
case .laravel: migrationSettings
|
||||
case .administration: administrationSettings
|
||||
case .exports: exportSettings
|
||||
case .advanced: advancedSettings
|
||||
}
|
||||
}
|
||||
.frame(maxWidth: .infinity, alignment: .leading)
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
}
|
||||
.navigationSplitViewStyle(.balanced)
|
||||
.frame(minWidth: 940, idealWidth: 1050, minHeight: 610, idealHeight: 710)
|
||||
.frame(minWidth: 850, idealWidth: 1050, minHeight: 570, idealHeight: 710)
|
||||
.preferredColorScheme(appearance == "dark" ? .dark : appearance == "light" ? .light : nil)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user