From 70a1cc2e63d2c49a135bd89cec3ffb1d427d90ee Mon Sep 17 00:00:00 2001
From: Ariver <shanghai3168@gmail.com>
Date: Tue, 30 Jun 2026 16:21:47 +0800
Subject: [PATCH] Freeze prep TagLauncher 8.2.9 Pro status UI
---
src/Apptag/PreferencesView.swift | 116 +++++++++++++++++++++++++++++++++++++++------------------
1 files changed, 79 insertions(+), 37 deletions(-)
diff --git a/src/Apptag/PreferencesView.swift b/src/Apptag/PreferencesView.swift
index 0e6c0e5..67f2899 100644
--- a/src/Apptag/PreferencesView.swift
+++ b/src/Apptag/PreferencesView.swift
@@ -688,6 +688,23 @@
Color(red: 0.56, green: 0.35, blue: 0.03)
}
+ @ViewBuilder
+ private func proHeaderStatusLabel(compact: Bool = false) -> some View {
+ if proEntitlement.accessState == .free && !proEntitlement.isPreviewingProAppearance {
+ Text(tr("settings.proStatus.freeUser"))
+ .font(.system(size: compact ? 12 : 13, weight: .semibold))
+ .foregroundStyle(.secondary)
+ .lineLimit(1)
+ .minimumScaleFactor(0.82)
+ } else {
+ ProStatusPill(
+ text: tr(proEntitlement.compactStatusTextKey),
+ style: proStatusPillStyle,
+ compact: compact
+ )
+ }
+ }
+
private func centeredSettingsScrollContent<Content: View>(
width: CGFloat,
@ViewBuilder content: @escaping () -> Content
@@ -733,10 +750,7 @@
compact: Bool = false
) -> some View {
HStack(spacing: compact ? 8 : 12) {
- ProStatusPill(
- text: tr(proEntitlement.compactStatusTextKey),
- style: proStatusPillStyle
- )
+ proHeaderStatusLabel(compact: compact)
.layoutPriority(1)
Text(tr(textKey))
@@ -811,7 +825,9 @@
}
switch selectedTab {
- case .general, .language, .about:
+ case .language, .about:
+ return ""
+ case .general:
return tr(proEntitlement.isUnlocked ? "settings.proBenefit.general" : "settings.proGuide.general")
case .theme:
return themeStatusSummary
@@ -827,43 +843,72 @@
}
private var shouldShowSettingsFixedProHeader: Bool {
- selectedTab != .language && selectedTab != .about
+ true
+ }
+
+ private var shouldCenterUnlockedIdentityHeader: Bool {
+ guard proEntitlement.isUnlocked else { return false }
+ switch selectedTab {
+ case .language, .pro, .about:
+ return true
+ case .general, .theme, .hotkeys, .tags, .data:
+ return false
+ }
}
private var settingsFixedProHeader: some View {
HStack {
HStack(spacing: 12) {
- if selectedTab != .pro {
+ if shouldCenterUnlockedIdentityHeader {
+ Spacer(minLength: 0)
+
ProStatusPill(
- text: tr(proEntitlement.compactStatusTextKey),
- style: proStatusPillStyle
+ text: tr("pro.status.unlocked"),
+ style: .unlocked,
+ compact: true
)
.layoutPriority(1)
- }
- Text(settingsProHeaderText)
- .font(.system(size: 13, weight: .medium))
- .foregroundStyle(.secondary)
- .lineLimit(2)
- .fixedSize(horizontal: false, vertical: true)
- .layoutPriority(2)
+ Text(tr("settings.proStatus.proUser"))
+ .font(.system(size: 13, weight: .medium))
+ .foregroundStyle(.secondary)
+ .lineLimit(1)
+ .fixedSize(horizontal: false, vertical: true)
+ .layoutPriority(2)
- Spacer(minLength: 8)
-
- if !proEntitlement.isUnlocked {
- Button(unlockButtonTitle()) {
- presentSettingsProPrompt(for: settingsProHeaderFeature)
+ Spacer(minLength: 0)
+ } else {
+ if selectedTab != .pro {
+ proHeaderStatusLabel(compact: true)
+ .layoutPriority(1)
}
- .buttonStyle(.borderedProminent)
- .controlSize(.small)
- .layoutPriority(3)
- Button(tr("pro.card.restore")) {
- proEntitlement.restorePurchases()
+ if !settingsProHeaderText.isEmpty {
+ Text(settingsProHeaderText)
+ .font(.system(size: 13, weight: .medium))
+ .foregroundStyle(.secondary)
+ .lineLimit(2)
+ .fixedSize(horizontal: false, vertical: true)
+ .layoutPriority(2)
}
- .buttonStyle(.bordered)
- .controlSize(.small)
- .layoutPriority(3)
+
+ Spacer(minLength: 8)
+
+ if !proEntitlement.isUnlocked {
+ Button(unlockButtonTitle()) {
+ presentSettingsProPrompt(for: settingsProHeaderFeature)
+ }
+ .buttonStyle(.borderedProminent)
+ .controlSize(.small)
+ .layoutPriority(3)
+
+ Button(tr("pro.card.restore")) {
+ proEntitlement.restorePurchases()
+ }
+ .buttonStyle(.bordered)
+ .controlSize(.small)
+ .layoutPriority(3)
+ }
}
}
.padding(.horizontal, 16)
@@ -953,7 +998,7 @@
Text(tr("settings.proCompare.free"))
.font(.system(size: 12, weight: .semibold))
.foregroundStyle(.secondary)
- .frame(width: 118, alignment: .center)
+ .frame(width: 118, alignment: .leading)
HStack(spacing: 4) {
Image(systemName: "crown")
.font(.system(size: 12, weight: .semibold))
@@ -963,7 +1008,7 @@
.foregroundStyle(proAccentColor)
.lineLimit(1)
.minimumScaleFactor(0.82)
- .frame(width: 118, alignment: .center)
+ .frame(width: 118, alignment: .leading)
}
ForEach(proTabComparisonFeatures) { feature in
@@ -983,14 +1028,14 @@
style: feature.freeStyle,
compact: true
)
- .frame(width: 118, alignment: .center)
+ .frame(width: 118, alignment: .leading)
ProStatusPill(
text: tr(proStatusKey),
style: proStyle,
compact: true
)
- .frame(width: 118, alignment: .center)
+ .frame(width: 118, alignment: .leading)
}
.padding(.horizontal, 10)
.padding(.vertical, 8)
@@ -1354,10 +1399,7 @@
proUnlockedBenefitLine("pro.theme.status.unlocked", bottomPadding: 0)
} else {
HStack(spacing: 12) {
- ProStatusPill(
- text: tr(proEntitlement.compactStatusTextKey),
- style: proStatusPillStyle
- )
+ proHeaderStatusLabel()
Text(themeStatusSummary)
.font(.system(size: 13, weight: .medium))
--
Gitblit v1.9.3