| | |
| | | // Tab 1: General |
| | | Form { |
| | | Section { |
| | | Toggle("Launch at login", isOn: $launchAtLogin) |
| | | .onChange(of: launchAtLogin) { _, enabled in |
| | | if enabled { |
| | | try? SMAppService.mainApp.register() |
| | | } else { |
| | | try? SMAppService.mainApp.unregister() |
| | | HStack(spacing: 20) { |
| | | Toggle("Launch at login", isOn: $launchAtLogin) |
| | | .onChange(of: launchAtLogin) { _, enabled in |
| | | if enabled { |
| | | try? SMAppService.mainApp.register() |
| | | } else { |
| | | try? SMAppService.mainApp.unregister() |
| | | } |
| | | } |
| | | } |
| | | Toggle("Show in Dock", isOn: $showDockIcon) |
| | | Toggle("Hide app names", isOn: $hideAppNames) |
| | | } |
| | | } |
| | | .padding(.bottom, 12) |
| | | |
| | | Section { |
| | | LabeledContent("App list style:") { |
| | |
| | | .font(.caption) |
| | | .foregroundStyle(.secondary) |
| | | } |
| | | |
| | | Section { |
| | | Toggle("Show in Dock", isOn: $showDockIcon) |
| | | } |
| | | |
| | | Section { |
| | | Toggle("Hide app names", isOn: $hideAppNames) |
| | | } |
| | | } |
| | | .tabItem { Label("General", systemImage: "gearshape") } |
| | | .padding() |
| | |
| | | |
| | | // Tab 3: Data |
| | | Form { |
| | | Section { |
| | | HStack { |
| | | Button("Re-index Now") { |
| | | NotificationCenter.default.post(name: .apptagReindex, object: nil) |
| | | } |
| | | .buttonStyle(.borderedProminent) |
| | | |
| | | Text("Re-scan all app directories and refresh the tag database.") |
| | | .font(.caption) |
| | | .foregroundStyle(.secondary) |
| | | } |
| | | } header: { |
| | | Text("Index Management") |
| | | } |
| | | |
| | | Section { |
| | | HStack(spacing: 12) { |
| | | Button("Export Tags…") { exportTags() } |