mirror of
https://github.com/maxgoedjen/secretive.git
synced 2024-11-22 05:27:28 +00:00
Fixes #51.
This commit is contained in:
parent
a6fbcdbe55
commit
1e3ece600d
@ -87,16 +87,30 @@ struct SetupStepCommandView: View {
|
|||||||
let text: String
|
let text: String
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
Text(text)
|
VStack(alignment: .leading) {
|
||||||
.font(.system(.caption, design: .monospaced))
|
Text(text)
|
||||||
.lineLimit(nil)
|
.lineLimit(nil)
|
||||||
.frame(idealHeight: 0, maxHeight: .infinity)
|
.font(.system(.caption, design: .monospaced))
|
||||||
.padding()
|
.multilineTextAlignment(.leading)
|
||||||
.background(Color(white: 0, opacity: 0.10))
|
HStack {
|
||||||
.cornerRadius(10)
|
Spacer()
|
||||||
.onDrag {
|
Button(action: copy) {
|
||||||
return NSItemProvider(item: NSData(data: self.text.data(using: .utf8)!), typeIdentifier: kUTTypeUTF8PlainText as String)
|
Text("Copy")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
.padding()
|
||||||
|
.background(Color(white: 0, opacity: 0.10))
|
||||||
|
.cornerRadius(10)
|
||||||
|
.onDrag {
|
||||||
|
return NSItemProvider(item: NSData(data: self.text.data(using: .utf8)!), typeIdentifier: kUTTypeUTF8PlainText as String)
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func copy() {
|
||||||
|
NSPasteboard.general.declareTypes([.string], owner: nil)
|
||||||
|
NSPasteboard.general.setString(text, forType: .string)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user