SoyuzCapsule/KlipperMon/KlipperMonApp.swift

36 lines
1001 B
Swift
Raw Normal View History

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 {
WindowGroup(id: "floating-stats") {
KlipperMonMenuBarExtraView(currentMenuBarIcon: $currentIcon)
2023-02-07 20:04:01 +00:00
.environment(\.managedObjectContext, persistenceController.container.viewContext)
//.frame(width: 300, height: 140)
2023-02-07 20:04:01 +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)
.padding([.top, .leading, .trailing], 8)
.padding([.bottom], 6)
2023-02-07 20:04:01 +00:00
}
.menuBarExtraStyle(.window)
}
}