diff options
| author | Dustin Mierau <mierau@users.noreply.github.com> | 2024-05-01 19:04:19 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-01 19:04:19 -0700 |
| commit | a5c1e0b475d14b176479f662bf29163f2220180b (patch) | |
| tree | 2a458fb29ade4e1c21fa662121bfa88a45c797de /Hotline/macOS/FilesView.swift | |
| parent | 44dcb81e80e167374e2d3217b81cf0148fa7d66a (diff) | |
| parent | c55cae05aeeb629fc9d2939c5f5e935ebc3ac92b (diff) | |
Merge pull request #14 from jhalter/get-set-file-info
Add Get/Set file info
Diffstat (limited to 'Hotline/macOS/FilesView.swift')
| -rw-r--r-- | Hotline/macOS/FilesView.swift | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Hotline/macOS/FilesView.swift b/Hotline/macOS/FilesView.swift index 397feb3..f698b5d 100644 --- a/Hotline/macOS/FilesView.swift +++ b/Hotline/macOS/FilesView.swift @@ -102,7 +102,8 @@ struct FilesView: View { @Environment(\.openWindow) private var openWindow @State private var selection: FileInfo? - + @State private var fileDetails: FileDetails? + private func openPreviewWindow(_ previewInfo: PreviewFileInfo) { switch previewInfo.previewType { case .image: @@ -206,6 +207,11 @@ struct FilesView: View { ToolbarItem(placement: .primaryAction) { Button { + if let s = selection { + model.fileDetails(s.name, path: s.path) { info in + fileDetails = info + } + } } label: { Label("Get File Info", systemImage: "info.circle") } @@ -224,6 +230,9 @@ struct FilesView: View { } } } + .sheet(item: $fileDetails ) { item in + FileDetailsView(fd: item) + } } } |