From 96f2043d73505f2923240e79a4a2e77d2b1c8059 Mon Sep 17 00:00:00 2001 From: Christoph Hagen Date: Mon, 17 Apr 2023 14:20:25 +0200 Subject: [PATCH] Improve cap row display --- Caps/Views/CapRowView.swift | 57 +++++++++++++++++------------------ Caps/Views/SettingsView.swift | 2 +- 2 files changed, 29 insertions(+), 30 deletions(-) diff --git a/Caps/Views/CapRowView.swift b/Caps/Views/CapRowView.swift index 921e233..6f9a11c 100644 --- a/Caps/Views/CapRowView.swift +++ b/Caps/Views/CapRowView.swift @@ -1,4 +1,5 @@ import SwiftUI +import SFSafeSymbols struct CapRowView: View { @@ -17,42 +18,40 @@ struct CapRowView: View { database.serverUrl.appendingPathComponent(cap.mainImagePath) } - var imageCountText: String { - guard cap.imageCount != 1 else { - return "\(cap.id) (1 image)" - } - return "\(cap.id) (\(cap.imageCount) images)" - } - var body: some View { HStack(alignment: .center) { VStack(alignment: .leading, spacing: 0) { - - HStack(spacing: 8) { - Text(imageCountText) - .font(.footnote) - if !cap.classifiable(by: database.classifierVersion) { - Text("📵") - } - if cap.imageCount < sufficientImageCount { - Text("⚠️") - } - if database.hasPendingUpdates(for: cap.id) { - Text("⇅") - } - if database.hasPendingOperations(for: cap.id) { - ProgressView() - } - } - .padding(.top, 0) - .font(.footnote) Text(cap.name) .font(.headline) .padding(.bottom, 3) - if let match = match { - Text("\(Int((match * 100).rounded())) % match") - .font(.footnote) + HStack(spacing: 4) { + Image(systemSymbol: .tag) + Text("\(cap.id)") + .padding(.trailing, 8) + Image(systemSymbol: .photoCircle) + Text("\(cap.imageCount)") + .padding(.trailing, 8) + if cap.imageCount < sufficientImageCount { + Image(systemSymbol: .eyeTrianglebadgeExclamationmark) + .padding(.trailing, 8) + } + if !database.canClassify(cap: cap.id) { + Image(systemSymbol: .eyeSlash) + .padding(.trailing, 8) + } + if database.hasPendingUpdates(for: cap.id) { + Image(systemSymbol: .arrowUpArrowDownCircle) + .padding(.trailing, 8) + } + if let match = match { + Image(systemSymbol: .target) + Text("\(Int((match * 100).rounded())) %") + .padding(.trailing, 8) + } } + .foregroundColor(.secondary) + .padding(.top, 0) + .font(.footnote) }//.padding(.vertical) Spacer() CachedCapImage(cap, cap.image, cache: database.images) { image in diff --git a/Caps/Views/SettingsView.swift b/Caps/Views/SettingsView.swift index 37161ab..76d6f80 100644 --- a/Caps/Views/SettingsView.swift +++ b/Caps/Views/SettingsView.swift @@ -58,7 +58,7 @@ struct SettingsView: View { Spacer() } .padding(.horizontal) - .navigationTitle("Settings") + .navigationTitle("Info") .onAppear(perform: updateImageCacheSize) } }