feat: Styles views for macos
This commit is contained in:
@@ -6,6 +6,7 @@ extension View {
|
||||
public func applyFormStyle() -> some View {
|
||||
self
|
||||
.labelsHidden()
|
||||
// .formStyle(.grouped)
|
||||
.textLabelStyle(.boldSecondary)
|
||||
.textFieldStyle(.roundedBorder)
|
||||
#if os(macOS)
|
||||
|
||||
@@ -67,6 +67,15 @@ public struct AutomaticTextLabelStyle: TextLabelStyle {
|
||||
}
|
||||
}
|
||||
|
||||
public struct DefaultSectionHeaderLabelStyle: TextLabelStyle {
|
||||
public func makeBody(configuration: Configuration) -> some View {
|
||||
configuration.label
|
||||
#if os(macOS)
|
||||
.font(.headline)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
private struct TextLabelStyleKey: EnvironmentKey {
|
||||
static let defaultValue = MainActor.assumeIsolated {
|
||||
AnyTextLabelStyle(style: AutomaticTextLabelStyle())
|
||||
@@ -75,7 +84,7 @@ private struct TextLabelStyleKey: EnvironmentKey {
|
||||
|
||||
private struct SectionHeaderLabelStyleKey: EnvironmentKey {
|
||||
static let defaultValue = MainActor.assumeIsolated {
|
||||
AnyTextLabelStyle(style: AutomaticTextLabelStyle())
|
||||
AnyTextLabelStyle(style: DefaultSectionHeaderLabelStyle())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user