feat: add menu bar app and bundle script
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import AppKit
|
||||
import SwiftUI
|
||||
|
||||
struct MenuContent: View {
|
||||
@ObservedObject var model: AppModel
|
||||
|
||||
var body: some View {
|
||||
Text(model.statusLine)
|
||||
if let error = model.lastError {
|
||||
Text("Fout: \(error)")
|
||||
}
|
||||
Divider()
|
||||
permissionRow("Microfoon", granted: model.micGranted, pane: "Privacy_Microphone")
|
||||
permissionRow("Accessibility", granted: model.accessibilityGranted, pane: "Privacy_Accessibility")
|
||||
permissionRow("Input Monitoring", granted: model.inputMonitoringGranted, pane: "Privacy_ListenEvent")
|
||||
Button("Rechten opnieuw controleren") { model.retryHotkey() }
|
||||
Divider()
|
||||
Button("Stop") { NSApplication.shared.terminate(nil) }
|
||||
.keyboardShortcut("q")
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
private func permissionRow(_ title: String, granted: Bool, pane: String) -> some View {
|
||||
if granted {
|
||||
Text("✓ \(title)")
|
||||
} else {
|
||||
Button("⚠︎ \(title) — open Instellingen") {
|
||||
if let url = URL(string: "x-apple.systempreferences:com.apple.preference.security?\(pane)") {
|
||||
NSWorkspace.shared.open(url)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user