Skip to content

Commit

Permalink
#105 Ability to copy version number to clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKai77 committed Nov 30, 2023
1 parent f6605ca commit 657709e
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions Loop/About Window/AboutView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,22 @@ struct AboutView: View {
.font(.title)
.fontWeight(.bold)

Text("Version \(Bundle.main.appVersion) (\(Bundle.main.appBuild))")
.font(.caption2)
.textSelection(.enabled)
.foregroundColor(.secondary)
Button(action: {
let pasteboard = NSPasteboard.general
pasteboard.clearContents()
pasteboard.setString(
"Version \(Bundle.main.appVersion) (\(Bundle.main.appBuild))",
forType: NSPasteboard.PasteboardType.string
)
},
label: {
// swiftlint:disable:next line_length
Text("Version \(Bundle.main.appVersion) (\(Bundle.main.appBuild)) \(Image(systemName: "doc.on.clipboard"))")
.font(.caption2)
.textSelection(.enabled)
.foregroundColor(.secondary)
})
.buttonStyle(.plain)
}

Spacer()
Expand Down

0 comments on commit 657709e

Please sign in to comment.