Better copy overlay
This commit is contained in:
parent
609c1c1bbb
commit
bf38890d09
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue