Initial Commit
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import SwiftUI
|
||||
|
||||
struct PathField: View {
|
||||
let title: String
|
||||
@Binding var path: String
|
||||
var canBrowse: Bool = true
|
||||
|
||||
var body: some View {
|
||||
VStack(alignment: .leading, spacing: 6) {
|
||||
Text(title).font(.headline)
|
||||
HStack {
|
||||
TextField(title, text: $path)
|
||||
.textFieldStyle(.roundedBorder)
|
||||
if canBrowse {
|
||||
Button("Choose…") {
|
||||
if let selected = FilePicker.chooseDirectory() { path = selected }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user