SoyuzCapsule/Soyuz/SoyuzApp.swift

32 lines
1.0 KiB
Swift
Raw Normal View History

2023-07-10 18:14:24 +00:00
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
2023-02-07 18:19:02 +00:00
import SwiftUI
@main
2023-02-21 05:42:27 +00:00
struct SoyuzApp: App {
2023-02-07 20:04:01 +00:00
let persistenceController = PersistenceController.shared
@State var currentIcon = "move.3d"
@ObservedObject static var printerManager = MoonrakerSocketManager()
2023-02-07 20:04:01 +00:00
var body: some Scene {
WindowGroup("Configuration", id: "soyuz_cfg", content: {
PrinterConfigView(printerManager: SoyuzApp.printerManager)
//.frame(minWidth: 300, maxWidth: 600, minHeight: 60, maxHeight: 100)
})
.windowResizability(.contentSize)
2023-02-07 20:04:01 +00:00
MenuBarExtra("Soyuz", systemImage: currentIcon) {
SoyuzMenuBarExtraView(printerManager: SoyuzApp.printerManager, currentMenuBarIcon: $currentIcon)
.padding([.top, .leading, .trailing], 8)
.padding([.bottom], 6)
2023-02-07 20:04:01 +00:00
}
.menuBarExtraStyle(.window)
}
}