Skip to content

Commit c82af45

Browse files
committed
use SwiftUI Link for urlButton
1 parent e6abb31 commit c82af45

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

src/config/ui.swift

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,7 @@ func footer(reset: @escaping () -> Void, apply: @escaping () -> Void, close: @es
5454
}
5555

5656
func urlButton(_ text: String, _ link: String) -> some View {
57-
Button(
58-
action: {
59-
if let url = URL(string: link) {
60-
NSWorkspace.shared.open(url)
61-
}
62-
},
63-
label: {
64-
Text(text)
65-
.foregroundColor(.blue)
66-
}
67-
).buttonStyle(PlainButtonStyle())
68-
.focusable(false)
57+
Link(text, destination: URL(string: link)!)
6958
}
7059

7160
struct SelectFileButton<Label>: View where Label: View {

0 commit comments

Comments
 (0)