diff options
| author | Dustin Mierau <dustin@mierau.me> | 2024-05-13 11:59:41 -0700 |
|---|---|---|
| committer | Dustin Mierau <dustin@mierau.me> | 2024-05-13 11:59:41 -0700 |
| commit | 67050d06a3bc2d28e969cf1388eafa95400c35a3 (patch) | |
| tree | a866c6b5684d54d7dd7427902780679ce476092a /Hotline/Shared/FileIconView.swift | |
| parent | 6f166f0f12aab78fb0ab69cca386c8d8450cd9cc (diff) | |
Make News toolbar buttons disable contextually. Use Finder folder icon in Files list.
Diffstat (limited to 'Hotline/Shared/FileIconView.swift')
| -rw-r--r-- | Hotline/Shared/FileIconView.swift | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Hotline/Shared/FileIconView.swift b/Hotline/Shared/FileIconView.swift index 7336cf3..ffc9051 100644 --- a/Hotline/Shared/FileIconView.swift +++ b/Hotline/Shared/FileIconView.swift @@ -1,6 +1,22 @@ import SwiftUI import UniformTypeIdentifiers +struct FolderIconView: View { + private func folderIcon() -> Image { +#if os(iOS) + return Image(systemName: "folder.fill") +#elseif os(macOS) + return Image(nsImage: NSWorkspace.shared.icon(for: UTType.folder)) +#endif + } + + var body: some View { + folderIcon() + .resizable() + .scaledToFit() + } +} + struct FileIconView: View { let filename: String |