Better copy overlay

This commit is contained in:
Max Goedjen 2020-03-06 19:07:38 -08:00
parent 609c1c1bbb
commit bf38890d09
No known key found for this signature in database
GPG Key ID: E58C21DD77B9B8E8

View File

@ -21,19 +21,22 @@ struct SecretDetailView<SecretType: Secret>: View {
}
Spacer().frame(height: 10)
GroupBox(label: Text("Public Key")) {
Text(keyWriter.openSSHString(secret: secret))
.multilineTextAlignment(.leading)
.frame(minWidth: 150, maxWidth: .infinity)
.padding()
VStack {
Text(keyWriter.openSSHString(secret: secret))
.multilineTextAlignment(.leading)
.frame(minWidth: 150, maxWidth: .infinity)
HStack {
Spacer()
Button(action: copy) {
Text("Copy")
}
}
}
.padding()
}
.onDrag {
return NSItemProvider(item: NSData(data: self.keyString.data(using: .utf8)!), typeIdentifier: kUTTypeUTF8PlainText as String)
}
.overlay(
Button(action: copy) {
Text("Copy")
}.padding(),
alignment: .bottomTrailing)
Spacer()
}
}.padding()