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