Skip to content

armgit / peel

Public Imported from GitHub
0

Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.

Show an app page's states with a colored symbol and secondary words

Țugui Dragoș41bd1e8bf795
diff --git a/Peel/Views/AppDetailView.swift b/Peel/Views/AppDetailView.swift
index 928b81a3..8040d2d2 100644
--- a/Peel/Views/AppDetailView.swift
+++ b/Peel/Views/AppDetailView.swift
@@ -230,9 +230,9 @@ struct AppDetailView: View {
VStack(alignment: .leading, spacing: 2) {
role.kind == .link ? Text("\(role.identifier): links") : Text(verbatim: role.name)
if role.others.isEmpty {
- Text("Nothing else on this Mac opens these.")
+ StatusLabel(title: Text("Nothing else on this Mac opens these."), tint: .accentColor)
.font(.caption)
- .foregroundStyle(Color.accentColor)
+ .foregroundStyle(.secondary)
} else {
Text("Then \(role.others.first ?? "") would open these.")
.font(.caption)
diff --git a/Peel/Views/AppHeader.swift b/Peel/Views/AppHeader.swift
index 9d11a735..59ce8346 100644
--- a/Peel/Views/AppHeader.swift
+++ b/Peel/Views/AppHeader.swift
@@ -52,9 +52,12 @@ struct AppHeader<Actions: View>: View {
Text(verbatim: "·")
.accessibilityHidden(true)
if let waitingVersion {
- Text(verbatim: "\(version) → \(waitingVersion)")
- .foregroundStyle(Color.accentColor)
- .accessibilityLabel(Text("\(version), update available: \(waitingVersion)"))
+ StatusLabel(
+ title: Text(verbatim: "\(version) → \(waitingVersion)"),
+ systemImage: "arrow.down.circle",
+ tint: .accentColor
+ )
+ .accessibilityLabel(Text("\(version), update available: \(waitingVersion)"))
} else {
Text(verbatim: version)
}
diff --git a/Peel/Views/AppPageHeader.swift b/Peel/Views/AppPageHeader.swift
index 891327b9..ff6d8075 100644
--- a/Peel/Views/AppPageHeader.swift
+++ b/Peel/Views/AppPageHeader.swift
@@ -217,35 +217,43 @@ struct AppPageHeader: View {
@ViewBuilder
private func outcome(of upgrade: AppLibrary.Upgrade) -> some View {
- if upgrade.succeeded {
- Label {
- if let version = upgrade.app.version {
- Text("Now on \(version).")
- } else {
- Text("Homebrew finished the upgrade.")
- }
- } icon: {
- Image(systemName: "checkmark.circle.fill")
+ Group {
+ if upgrade.succeeded {
+ StatusLabel(
+ title: upgrade.app.version.map { Text("Now on \($0).") } ?? Text("Homebrew finished the upgrade."),
+ systemImage: "checkmark.circle.fill",
+ tint: .green
+ )
+ } else {
+ StatusLabel(
+ title: Text("Homebrew couldn’t finish the upgrade."),
+ systemImage: "exclamationmark.triangle.fill",
+ tint: .red
+ )
}
- .font(.caption)
- .foregroundStyle(.green)
- } else {
- Label("Homebrew couldn’t finish the upgrade.", systemImage: "exclamationmark.triangle.fill")
- .font(.caption)
- .foregroundStyle(.red)
}
+ .font(.caption)
+ .foregroundStyle(.secondary)
}
@ViewBuilder
private func outcome(of privacyReset: PrivacyReset.Result) -> some View {
- if let problem = privacyReset.explanation {
- Label("Privacy permissions weren’t reset. \(problem)", systemImage: "exclamationmark.triangle.fill")
- .font(.caption)
- .foregroundStyle(.red)
- } else {
- Label("Privacy permissions were reset. \(plan.app.name) asks you again the next time it needs them.", systemImage: "checkmark.circle.fill")
- .font(.caption)
- .foregroundStyle(.green)
+ Group {
+ if let problem = privacyReset.explanation {
+ StatusLabel(
+ title: Text("Privacy permissions weren’t reset. \(problem)"),
+ systemImage: "exclamationmark.triangle.fill",
+ tint: .red
+ )
+ } else {
+ StatusLabel(
+ title: Text("Privacy permissions were reset. \(plan.app.name) asks you again the next time it needs them."),
+ systemImage: "checkmark.circle.fill",
+ tint: .green
+ )
+ }
}
+ .font(.caption)
+ .foregroundStyle(.secondary)
}
}