diff options
| author | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2024-04-28 13:33:31 -0700 |
|---|---|---|
| committer | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2024-04-28 13:33:31 -0700 |
| commit | 494d8dd03568cedda3a6c9bc86cd854f2bb857a9 (patch) | |
| tree | bfe3eb80a5e47e4fa0b1f818f294cb7fbd4749fc /Hotline/macOS/FilesView.swift | |
| parent | 1a82975ad00bced8bba8cd6df6a9920a7ae93c61 (diff) | |
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) + } } } |