2023-02-07 18:19:02 +00:00
|
|
|
//
|
|
|
|
// KlipperMonApp.swift
|
|
|
|
// KlipperMon
|
|
|
|
//
|
|
|
|
// Created by maddiefuzz on 2/7/23.
|
|
|
|
//
|
|
|
|
|
|
|
|
import SwiftUI
|
|
|
|
|
|
|
|
@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 {
|
2023-02-09 01:19:23 +00:00
|
|
|
WindowGroup(id: "floating-stats") {
|
|
|
|
KlipperMonMenuBarExtraView(currentMenuBarIcon: $currentIcon)
|
2023-02-07 20:04:01 +00:00
|
|
|
.environment(\.managedObjectContext, persistenceController.container.viewContext)
|
2023-02-09 01:19:23 +00:00
|
|
|
//.frame(width: 300, height: 140)
|
2023-02-07 20:04:01 +00:00
|
|
|
}
|
2023-02-09 01:19:23 +00:00
|
|
|
//.windowResizability(.contentSize)
|
|
|
|
|
|
|
|
Window("Configuration", id: "soyuz_cfg", content: {
|
|
|
|
PrinterConfigView()
|
|
|
|
})
|
2023-02-07 20:04:01 +00:00
|
|
|
|
|
|
|
MenuBarExtra("Soyuz", systemImage: currentIcon) {
|
|
|
|
KlipperMonMenuBarExtraView(currentMenuBarIcon: $currentIcon)
|
2023-02-09 01:19:23 +00:00
|
|
|
.padding([.top, .leading, .trailing], 8)
|
|
|
|
.padding([.bottom], 6)
|
2023-02-07 20:04:01 +00:00
|
|
|
}
|
|
|
|
.menuBarExtraStyle(.window)
|
|
|
|
}
|
|
|
|
}
|