sindresorhus / Settings

⚙ Add a settings window to your macOS app in minutes
MIT License
1.45k stars 101 forks source link

How to horizontally align section within a container? #106

Open kkyr opened 1 year ago

kkyr commented 1 year ago

How can I horizontally align to the center a section that is within a container?

struct KeyBindingsView: View {
    private let contentWidth =  500.0

    var body: some View {
        Settings.Container(contentWidth: contentWidth) {
            Settings.Section(title: "Section Title:") {
                Settings.Section(title: "") {
                    KeyboardShortcuts.Recorder(for: .activate)
                    Text("Do something.")
                        .settingDescription()
                }
            }
        }
    }
}

Screenshot 2023-08-03 at 01 34 40