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,34 @@
|
||||
import SwiftUI
|
||||
|
||||
struct SettingsView: View {
|
||||
var body: some View {
|
||||
TabView {
|
||||
Form {
|
||||
LabeledContent("Status", value: "Paused")
|
||||
Text("Server and device configuration will be available in a later build.")
|
||||
}
|
||||
.tabItem { Label("Connection", systemImage: "network") }
|
||||
|
||||
Form {
|
||||
Text("Continuous tracking, manual location and SOS are not implemented yet.")
|
||||
Text("This build does not request your location or send positions.")
|
||||
}
|
||||
.tabItem { Label("Tracking", systemImage: "location") }
|
||||
|
||||
Form {
|
||||
Text("Login startup and tracking restoration are not enabled.")
|
||||
Text("Closing Settings keeps the app in the menu bar. Use Quit to exit.")
|
||||
}
|
||||
.tabItem { Label("General", systemImage: "gearshape") }
|
||||
|
||||
Form {
|
||||
LabeledContent("Status", value: "Paused")
|
||||
Text("No location or network activity is started by this application shell.")
|
||||
}
|
||||
.tabItem { Label("Diagnostics", systemImage: "waveform.path.ecg") }
|
||||
}
|
||||
.formStyle(.grouped)
|
||||
.padding()
|
||||
.frame(width: 560, height: 320)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
import AppKit
|
||||
import SwiftUI
|
||||
|
||||
struct TrackingMenu: View {
|
||||
@Environment(\.openSettings) private var openSettings
|
||||
|
||||
var body: some View {
|
||||
Text("Paused")
|
||||
Text("Tracking is not available in this build.")
|
||||
|
||||
Divider()
|
||||
|
||||
Button("Start tracking") {}
|
||||
.disabled(true)
|
||||
Button("Send location now") {}
|
||||
.disabled(true)
|
||||
Button("Send SOS") {}
|
||||
.disabled(true)
|
||||
|
||||
Divider()
|
||||
|
||||
Button("Settings…") {
|
||||
NSApplication.shared.activate(ignoringOtherApps: true)
|
||||
openSettings()
|
||||
}
|
||||
.keyboardShortcut(",")
|
||||
|
||||
Button("About Traccar Client for macOS") {
|
||||
NSApplication.shared.activate(ignoringOtherApps: true)
|
||||
NSApplication.shared.orderFrontStandardAboutPanel(options: [
|
||||
.applicationName: "Traccar Client for macOS",
|
||||
.credits: NSAttributedString(
|
||||
string: "An independent, unofficial Traccar client.\nLicensed under Apache License 2.0."
|
||||
),
|
||||
])
|
||||
}
|
||||
|
||||
Divider()
|
||||
|
||||
Button("Quit Traccar Client macOS") {
|
||||
NSApplication.shared.terminate(nil)
|
||||
}
|
||||
.keyboardShortcut("q")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user