| | |
| | | // MARK: - Notification for manual re-index |
| | | |
| | | extension Notification.Name { |
| | | static let apptagReindex = Notification.Name("ApptagReindex") |
| | | static let apptagEditModeChanged = Notification.Name("ApptagEditModeChanged") |
| | | } |
| | | |
| | |
| | | .onReceive(NotificationCenter.default.publisher(for: NSApplication.didBecomeActiveNotification)) { _ in |
| | | refreshApps() |
| | | } |
| | | .onReceive(NotificationCenter.default.publisher(for: .apptagReindex)) { _ in |
| | | refreshApps() |
| | | } |
| | | .onChange(of: editPhase) { _, newPhase in |
| | | let active = newPhase != .none |
| | | NotificationCenter.default.post( |
| | |
| | | else { highlightedGroup = tag.id } |
| | | scrollTo(tag.id) |
| | | }) |
| | | .onHover { hovering in |
| | | if hovering { scrollTo(tag.id) } |
| | | } |
| | | } |
| | | }.padding(.horizontal, 24) |
| | | } |
| | |
| | | else { highlightedGroup = tag.id } |
| | | scrollTo(tag.id) |
| | | }) |
| | | .onHover { hovering in |
| | | if hovering { scrollTo(tag.id) } |
| | | } |
| | | } |
| | | }.padding(12) |
| | | }.frame(width: 135) |
| | |
| | | ).id(group.id) |
| | | } |
| | | }.padding(20) |
| | | }.onAppear { scrollProxy = proxy } |
| | | } |
| | | .id(displayMode) // force rebuild on mode switch |
| | | .onAppear { scrollProxy = proxy } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | .padding(outerPad) |
| | | } |
| | | .id(displayMode) // force rebuild on mode switch |
| | | .onAppear { scrollProxy = proxy } |
| | | } |
| | | } |
| | |
| | | return VStack(alignment: .leading, spacing: 6) { |
| | | HStack(spacing: 0) { |
| | | Rectangle().fill(.secondary.opacity(0.25)).frame(height: 1) |
| | | .layoutPriority(0) |
| | | Text(group.name) |
| | | .font(.system(size: tagFontSize, weight: .semibold)) |
| | | .foregroundStyle(.secondary) |
| | | .lineLimit(1) |
| | | .truncationMode(.middle) |
| | | .padding(.horizontal, 10) |
| | | .layoutPriority(1) |
| | | Rectangle().fill(.secondary.opacity(0.25)).frame(height: 1) |
| | | .layoutPriority(0) |
| | | } |
| | | let itemSize = iconSize + 28 |
| | | LazyVGrid( |