2026-09-19 16:53:49 +02:00
|
|
|
import Foundation
|
|
|
|
|
|
|
|
|
|
/// Maps KeePass's standard icon palette (indices 0-68) to an approximate SF Symbol.
|
2026-09-20 15:05:19 +02:00
|
|
|
/// This is a best-effort visual match, not the actual KeePass icon artwork -- KeeVault's
|
2026-09-19 16:53:49 +02:00
|
|
|
/// data model only stores the numeric iconIndex, not custom icon images.
|
|
|
|
|
public enum KeePassIconMapper {
|
|
|
|
|
private static let symbolsByIndex: [Int: String] = [
|
|
|
|
|
0: "key.fill",
|
|
|
|
|
1: "globe",
|
|
|
|
|
2: "exclamationmark.triangle.fill",
|
|
|
|
|
3: "server.rack",
|
|
|
|
|
4: "doc.on.clipboard.fill",
|
|
|
|
|
5: "pencil",
|
|
|
|
|
6: "camera.fill",
|
|
|
|
|
7: "wrench.fill",
|
|
|
|
|
8: "person.text.rectangle.fill",
|
|
|
|
|
9: "externaldrive.fill",
|
|
|
|
|
10: "creditcard.fill",
|
|
|
|
|
11: "chevron.left.forwardslash.chevron.right",
|
|
|
|
|
12: "chart.bar.fill",
|
|
|
|
|
13: "gamecontroller.fill",
|
|
|
|
|
14: "envelope.fill",
|
|
|
|
|
15: "folder.fill",
|
|
|
|
|
16: "lock.fill",
|
|
|
|
|
17: "checkmark.circle.fill",
|
|
|
|
|
18: "star.fill",
|
|
|
|
|
19: "house.fill",
|
|
|
|
|
20: "network",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
public static func symbolName(forIconIndex index: Int) -> String {
|
|
|
|
|
symbolsByIndex[index] ?? "key.fill"
|
|
|
|
|
}
|
|
|
|
|
}
|