forked from github/CopilotForXcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInsertButton.swift
More file actions
30 lines (25 loc) · 735 Bytes
/
Copy pathInsertButton.swift
File metadata and controls
30 lines (25 loc) · 735 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
27
28
29
30
import SwiftUI
public struct InsertButton: View {
public var insert: () -> Void
@Environment(\.colorScheme) var colorScheme
private var icon: Image {
return Image("CodeBlockInsertIcon")
}
public init(insert: @escaping () -> Void) {
self.insert = insert
}
public var body: some View {
Button(action: {
insert()
}) {
self.icon
.resizable()
.aspectRatio(contentMode: .fit)
.scaledFrame(width: 14, height: 14)
.foregroundColor(.secondary)
.padding(4)
}
.buttonStyle(HoverButtonStyle(padding: 0))
.help("Insert at Cursor")
}
}