mirror of
https://github.com/jayanezj/traccar-client-macos.git
synced 2026-11-05 03:00:46 +01:00
feat: add native macOS menu-bar application shell (#1)
This commit is contained in:
28 files changed
+695
No files matched your search
@@ -0,0 +1,29 @@
|
||||
import AppKit
|
||||
import SwiftUI
|
||||
|
||||
@main
|
||||
struct TraccarClientApp: App {
|
||||
@NSApplicationDelegateAdaptor(ApplicationDelegate.self) private var delegate
|
||||
|
||||
var body: some Scene {
|
||||
MenuBarExtra {
|
||||
TrackingMenu()
|
||||
} label: {
|
||||
Image("MenuBarIcon")
|
||||
.renderingMode(.template)
|
||||
.accessibilityLabel("Traccar Client — Paused")
|
||||
}
|
||||
.menuBarExtraStyle(.menu)
|
||||
|
||||
Settings {
|
||||
SettingsView()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@MainActor
|
||||
final class ApplicationDelegate: NSObject, NSApplicationDelegate {
|
||||
func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
|
||||
false
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user