forked from github/CopilotForXcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCardGroupBoxStyle.swift
More file actions
23 lines (22 loc) · 806 Bytes
/
CardGroupBoxStyle.swift
File metadata and controls
23 lines (22 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import SwiftUI
public struct CardGroupBoxStyle: GroupBoxStyle {
public var backgroundColor: Color
public init(backgroundColor: Color = Color("GroupBoxBackgroundColor")) {
self.backgroundColor = backgroundColor
}
public func makeBody(configuration: Configuration) -> some View {
VStack(alignment: .leading, spacing: 11) {
configuration.label.foregroundColor(.primary)
configuration.content.foregroundColor(.primary)
}
.padding(8)
.frame(maxWidth: .infinity, alignment: .topLeading)
.background(backgroundColor)
.cornerRadius(4)
.overlay(
RoundedRectangle(cornerRadius: 4)
.inset(by: 0.5)
.stroke(Color("GroupBoxStrokeColor"), lineWidth: 1)
)
}
}