Fix style
Some checks are pending
Deploy Docs / publish (push) Waiting to run
SwiftLint / SwiftLint (push) Successful in 2s

This commit is contained in:
david-swift 2024-11-10 10:41:15 +01:00
parent 266fb1dc23
commit 24ae87f124
3 changed files with 16 additions and 5 deletions

View File

@ -3,7 +3,6 @@ opt_in_rules:
- anonymous_argument_in_multiline_closure - anonymous_argument_in_multiline_closure
- array_init - array_init
- attributes - attributes
- closure_body_length
- closure_end_indentation - closure_end_indentation
- closure_spacing - closure_spacing
- collection_alignment - collection_alignment

View File

@ -43,7 +43,7 @@ public enum Icon: WinUIWidget, Equatable {
data: WidgetData, data: WidgetData,
updateProperties: Bool, updateProperties: Bool,
type: Data.Type type: Data.Type
) where Data : ViewRenderData { ) where Data: ViewRenderData {
guard updateProperties else { guard updateProperties else {
return return
} }

View File

@ -80,15 +80,27 @@ struct ContentView: View {
SettingsControl("Button Control", icon: .systemIcon(unicode: "\u{E7C9}")) { SettingsControl("Button Control", icon: .systemIcon(unicode: "\u{E7C9}")) {
Button("Control") { } Button("Control") { }
} }
SettingsControl("Combo Box", icon: .systemIcon(unicode: "\u{E700}"), description: "Selected item: \(comboBoxSelection)") { SettingsControl(
"Combo Box",
icon: .systemIcon(unicode: "\u{E700}"),
description: "Selected item: \(comboBoxSelection)"
) {
ComboBox(NavigationItem.allCases, selection: $comboBoxSelection) ComboBox(NavigationItem.allCases, selection: $comboBoxSelection)
} }
SettingsControl("Toggle Switch", icon: .systemIcon(unicode: "\u{F19E}"), description: "Current state: \(switchState ? "on" : "off")") { SettingsControl(
"Toggle Switch",
icon: .systemIcon(unicode: "\u{F19E}"),
description: "Current state: \(switchState ? "on" : "off")"
) {
ToggleSwitch(isOn: $switchState) ToggleSwitch(isOn: $switchState)
} }
} }
SettingsSection("About") { SettingsSection("About") {
SettingsControl("WinUI for Swift Demo", icon: .systemIcon(unicode: "\u{E946}"), description: "main") { SettingsControl(
"WinUI for Swift Demo",
icon: .systemIcon(unicode: "\u{E946}"),
description: "main"
) {
HyperlinkButton("Website", url: "https://aparoksha.dev/") HyperlinkButton("Website", url: "https://aparoksha.dev/")
} }
} }