new tests
This commit is contained in:
+40
-10
@@ -167,16 +167,45 @@ struct WorkbenchSettingsView: View {
|
||||
@AppStorage("preferences.confirmDestructiveSQL") private var confirmDestructiveSQL = true
|
||||
|
||||
var body: some View {
|
||||
NavigationSplitView {
|
||||
List(SettingsSection.allCases, selection: $selectedSection) { section in
|
||||
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)
|
||||
.tag(section)
|
||||
.padding(.vertical, 3)
|
||||
.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)
|
||||
)
|
||||
}
|
||||
.listStyle(.sidebar)
|
||||
.navigationTitle("Settings")
|
||||
.frame(minWidth: 205)
|
||||
} detail: {
|
||||
.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
|
||||
@@ -193,10 +222,11 @@ struct WorkbenchSettingsView: View {
|
||||
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