diff --git a/Mac/CloudKitStats/CloudKitStatsLayout.swift b/Mac/CloudKitStats/CloudKitStatsLayout.swift index 683d16398..add6e39ad 100644 --- a/Mac/CloudKitStats/CloudKitStatsLayout.swift +++ b/Mac/CloudKitStats/CloudKitStatsLayout.swift @@ -22,6 +22,7 @@ enum CloudKitStatsLayout { static let fetchingAlpha: CGFloat = 0.4 static let animationDuration: CGFloat = 0.25 static let starColor = Assets.Colors.star + static let warningColor = NSColor.systemOrange @MainActor static func makeDivider() -> NSView { let divider = NSBox() diff --git a/Mac/CloudKitStats/Scan/CloudKitStatsScanViewController.swift b/Mac/CloudKitStats/Scan/CloudKitStatsScanViewController.swift index 568119519..c22692da2 100644 --- a/Mac/CloudKitStats/Scan/CloudKitStatsScanViewController.swift +++ b/Mac/CloudKitStats/Scan/CloudKitStatsScanViewController.swift @@ -147,6 +147,16 @@ private extension CloudKitStatsScanViewController { let statusSectionDone = !isFetching || stats.articleCount > 0 contentView.statusSectionView.animator().alphaValue = statusSectionDone ? 1.0 : CloudKitStatsLayout.fetchingAlpha contentView.articleSectionView.animator().alphaValue = isFetching ? CloudKitStatsLayout.fetchingAlpha : 1.0 + + let syncUnreadContent = UserDefaults.standard.bool(forKey: Account.iCloudSyncArticleContentForUnreadArticlesKey) + updateWarningColor(contentView.staleCountLabel, count: stats.staleStatusCount) + updateWarningColor(contentView.unreadContentCountLabel, count: syncUnreadContent ? 0 : stats.unreadArticleCount) + updateWarningColor(contentView.readContentCountLabel, count: stats.readArticleCount) + updateWarningColor(contentView.orphanedContentCountLabel, count: stats.orphanedArticleCount) + } + + func updateWarningColor(_ label: NSTextField, count: Int) { + label.textColor = count > 0 ? CloudKitStatsLayout.warningColor : .labelColor } func showErrorAlertIfNeeded() {