| | |
| | | @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" |
| | |
| | | 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 { |
| | |
| | | group: group, |
| | | onSelectApp: { app in openApp(app) }, |
| | | tagFontSize: tagFontSize, |
| | | iconSize: iconSize |
| | | iconSize: iconSize, |
| | | showNames: !hideAppNames |
| | | ).id(group.id) |
| | | } |
| | | }.padding(20) |
| | |
| | | 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) }) |
| | | } |
| | | } |
| | | } |