From 2f8f71d0410f59d5d303a4c221a628630168bfe2 Mon Sep 17 00:00:00 2001 From: Dustin Mierau Date: Fri, 5 Jan 2024 19:46:13 -0800 Subject: Add image preview to Files so you don't have to download images to view them, works with animated GIFs too. Added cmd-R shortcut for Servers window. More work on login view. --- Hotline/Models/PreviewFileInfo.swift | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Hotline/Models/PreviewFileInfo.swift (limited to 'Hotline/Models/PreviewFileInfo.swift') diff --git a/Hotline/Models/PreviewFileInfo.swift b/Hotline/Models/PreviewFileInfo.swift new file mode 100644 index 0000000..9a4c980 --- /dev/null +++ b/Hotline/Models/PreviewFileInfo.swift @@ -0,0 +1,20 @@ + +struct PreviewFileInfo: Identifiable, Codable { + var id: UInt32 + var address: String + var port: Int + var size: Int + var name: String +} + +extension PreviewFileInfo: Equatable { + static func == (lhs: PreviewFileInfo, rhs: PreviewFileInfo) -> Bool { + return lhs.id == rhs.id + } +} + +extension PreviewFileInfo: Hashable { + func hash(into hasher: inout Hasher) { + hasher.combine(self.id) + } +} -- cgit