2023-02-07 18:19:02 +00:00
|
|
|
//
|
|
|
|
// KlipperMonApp.swift
|
|
|
|
// KlipperMon
|
|
|
|
//
|
|
|
|
// Created by maddiefuzz on 2/7/23.
|
|
|
|
//
|
|
|
|
|
|
|
|
import SwiftUI
|
|
|
|
|
2023-02-07 20:04:01 +00:00
|
|
|
|
2023-02-07 18:19:02 +00:00
|
|
|
@main
|
2023-02-07 20:04:01 +00:00
|
|
|
struct KlipperMonMenuBarApp: App {
|
|
|
|
let persistenceController = PersistenceController.shared
|
|
|
|
|
|
|
|
@State var currentIcon = "move.3d"
|
|
|
|
|
|
|
|
var body: some Scene {
|
|
|
|
WindowGroup {
|
|
|
|
ContentView()
|
|
|
|
.environment(\.managedObjectContext, persistenceController.container.viewContext)
|
|
|
|
}
|
|
|
|
|
|
|
|
MenuBarExtra("Soyuz", systemImage: currentIcon) {
|
|
|
|
KlipperMonMenuBarExtraView(currentMenuBarIcon: $currentIcon)
|
|
|
|
}
|
|
|
|
.menuBarExtraStyle(.window)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
protocol MenuBarExtraIconUpdater {
|
|
|
|
func updateIcon(systemName: String)
|
|
|
|
}
|
|
|
|
|
2023-02-07 18:19:02 +00:00
|
|
|
struct KlipperMonApp: App {
|
|
|
|
let persistenceController = PersistenceController.shared
|
|
|
|
|
|
|
|
var body: some Scene {
|
|
|
|
WindowGroup {
|
|
|
|
ContentView()
|
|
|
|
.environment(\.managedObjectContext, persistenceController.container.viewContext)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|