From 7a55ef704cb2c4a9c67766105cafb9ce13186772 Mon Sep 17 00:00:00 2001
From: Ariver <ar@MacBook-Air.local>
Date: Wed, 06 May 2026 17:01:56 +0800
Subject: [PATCH] checkpoint: v3.0.7 — 隐藏 APP 名称时 hover 自动显示
---
Apptag/ContentView.swift | 16 ++++++++++------
1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/Apptag/ContentView.swift b/Apptag/ContentView.swift
index d5d8626..66c849e 100644
--- a/Apptag/ContentView.swift
+++ b/Apptag/ContentView.swift
@@ -212,6 +212,7 @@
@AppStorage("tagPosition") private var tagPosition = "left"
@State private var notchHeight: CGFloat = 0
@AppStorage("displayMode") private var displayMode = "flat"
+ @AppStorage("hideAppNames") private var hideAppNames = false
private var isSideLayout: Bool {
tagPosition == "left" || tagPosition == "right"
@@ -271,10 +272,10 @@
if phase != .none {
NotificationCenter.default.post(name: .apptagEditModeChanged, object: nil, userInfo: ["active": true])
NSApp.activate(ignoringOtherApps: true)
- // Sync drag order from database when entering edit mode
- if draggedTagNames.isEmpty {
- draggedTagNames = TagEditor.orderedTagNames()
- }
+ // Always sync tag list from database when entering edit mode
+ let store = TagDatabase.load()
+ tagColors = store.tags.mapValues { $0.color }
+ draggedTagNames = TagEditor.orderedTagNames()
}
editPhase = phase
if phase == .none {
@@ -382,7 +383,8 @@
group: group,
onSelectApp: { app in openApp(app) },
tagFontSize: tagFontSize,
- iconSize: iconSize
+ iconSize: iconSize,
+ showNames: !hideAppNames
).id(group.id)
}
}.padding(20)
@@ -445,6 +447,8 @@
Text(group.name)
.font(.system(size: tagFontSize, weight: .semibold))
.foregroundStyle(.secondary)
+ .lineLimit(1)
+ .truncationMode(.middle)
.padding(.horizontal, 10)
Rectangle().fill(.secondary.opacity(0.25)).frame(height: 1)
}
@@ -454,7 +458,7 @@
spacing: 2
) {
ForEach(group.apps) { app in
- AppGridItem(app: app, iconSize: iconSize, onSelect: { openApp(app) })
+ AppGridItem(app: app, iconSize: iconSize, showName: !hideAppNames, onSelect: { openApp(app) })
}
}
}
--
Gitblit v1.9.3