forked from intitni/CopilotForXcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStyles.swift
More file actions
26 lines (24 loc) · 975 Bytes
/
Styles.swift
File metadata and controls
26 lines (24 loc) · 975 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import SwiftUI
struct CopilotButtonStyle: ButtonStyle {
func makeBody(configuration: Configuration) -> some View {
configuration.label
.padding(.vertical, 4)
.padding(.horizontal, 8)
.background(
RoundedRectangle(cornerRadius: 4, style: .continuous)
.fill(
configuration.isPressed
? Color("ButtonBackgroundColorPressed")
: Color("ButtonBackgroundColorDefault")
)
.animation(.easeOut(duration: 0.1), value: configuration.isPressed)
)
.overlay {
RoundedRectangle(cornerRadius: 4, style: .continuous)
.stroke(Color.white.opacity(0.2), style: .init(lineWidth: 1))
}
}
}
extension ButtonStyle where Self == CopilotButtonStyle {
static var copilot: CopilotButtonStyle { CopilotButtonStyle() }
}