SoyuzCapsule/KlipperMon/KlipperMonApp.swift
Madeline 5f429b8cb4 Add NWBrowser and NWConnection code.
TODO: Refactor all of this stuff better
2023-02-08 20:19:23 -05:00

36 lines
1001 B
Swift

//
// KlipperMonApp.swift
// KlipperMon
//
// Created by maddiefuzz on 2/7/23.
//
import SwiftUI
@main
struct KlipperMonMenuBarApp: App {
let persistenceController = PersistenceController.shared
@State var currentIcon = "move.3d"
var body: some Scene {
WindowGroup(id: "floating-stats") {
KlipperMonMenuBarExtraView(currentMenuBarIcon: $currentIcon)
.environment(\.managedObjectContext, persistenceController.container.viewContext)
//.frame(width: 300, height: 140)
}
//.windowResizability(.contentSize)
Window("Configuration", id: "soyuz_cfg", content: {
PrinterConfigView()
})
MenuBarExtra("Soyuz", systemImage: currentIcon) {
KlipperMonMenuBarExtraView(currentMenuBarIcon: $currentIcon)
.padding([.top, .leading, .trailing], 8)
.padding([.bottom], 6)
}
.menuBarExtraStyle(.window)
}
}