From 24d94e230985f815c02dd808319fd3b00bc26864 Mon Sep 17 00:00:00 2001
From: Ariver <shanghai3168@gmail.com>
Date: Mon, 18 May 2026 17:04:31 +0800
Subject: [PATCH] Center tag settings layout
---
Apptag/PreferencesView.swift | 47 +++++++++++++++++++++++++++++++++++++++--------
1 files changed, 39 insertions(+), 8 deletions(-)
diff --git a/Apptag/PreferencesView.swift b/Apptag/PreferencesView.swift
index cd28edb..1a89d05 100644
--- a/Apptag/PreferencesView.swift
+++ b/Apptag/PreferencesView.swift
@@ -219,6 +219,25 @@
return FileManager.default.fileExists(atPath: path)
}
+ private func bubbleScopeOption(
+ _ title: String,
+ isSelected: Bool,
+ action: @escaping () -> Void
+ ) -> some View {
+ Button(action: action) {
+ HStack(spacing: 6) {
+ Image(systemName: isSelected ? "largecircle.fill.circle" : "circle")
+ .font(.system(size: 13, weight: .medium))
+ .frame(width: 16, height: 16)
+ Text(title)
+ .font(.system(size: 13, weight: .medium))
+ }
+ .foregroundStyle(isSelected ? Color.accentColor : Color.primary)
+ .contentShape(Rectangle())
+ }
+ .buttonStyle(.plain)
+ }
+
private func syncSelectedLanguage() {
let code = L10n.currentCode
guard selectedLanguage != code else { return }
@@ -465,7 +484,6 @@
onRefresh: { scanApps() }
)
}
- .padding(.leading, 16)
.tabItem { Label(tr("settings.tags"), systemImage: "tag.fill") }
.onAppear { scanApps() }
@@ -580,15 +598,28 @@
Spacer(minLength: 22)
- VStack(alignment: .leading, spacing: 5) {
- Toggle(tr("settings.uncommonBubble"), isOn: $showUncommonAppBubbles)
+ HStack(alignment: .center, spacing: 14) {
+ Text(tr("settings.bubbleDisplayScope"))
.font(.system(size: 13, weight: .medium))
- Text(tr("settings.uncommonBubbleDesc"))
- .font(.caption)
- .foregroundStyle(.secondary)
- .fixedSize(horizontal: false, vertical: true)
+ .frame(width: 190, alignment: .trailing)
+
+ HStack(spacing: 20) {
+ bubbleScopeOption(
+ tr("settings.bubbleAllApps"),
+ isSelected: !showUncommonAppBubbles
+ ) {
+ showUncommonAppBubbles = false
+ }
+ bubbleScopeOption(
+ tr("settings.bubbleUncommonOnly"),
+ isSelected: showUncommonAppBubbles
+ ) {
+ showUncommonAppBubbles = true
+ }
+ }
+ .frame(width: 300, alignment: .leading)
}
- .frame(width: 420, alignment: .leading)
+ .frame(width: 520, alignment: .center)
Spacer(minLength: 18)
}
--
Gitblit v1.9.3