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"
|
|
|
|
|
2023-04-05 17:49:05 +00:00
|
|
|
@ObservedObject static var printerManager = MoonrakerSocketManager()
|
2023-03-20 23:58:40 +00:00
|
|
|
|
2023-02-07 20:04:01 +00:00
|
|
|
var body: some Scene {
|
2023-02-21 05:35:54 +00:00
|
|
|
WindowGroup("Configuration", id: "soyuz_cfg", content: {
|
2023-03-21 00:31:18 +00:00
|
|
|
PrinterConfigView(printerManager: SoyuzApp.printerManager)
|
2023-02-21 05:35:54 +00:00
|
|
|
//.frame(minWidth: 300, maxWidth: 600, minHeight: 60, maxHeight: 100)
|
2023-02-09 01:19:23 +00:00
|
|
|
})
|
2023-02-21 05:35:54 +00:00
|
|
|
.windowResizability(.contentSize)
|
2023-02-07 20:04:01 +00:00
|
|
|
|
|
|
|
MenuBarExtra("Soyuz", systemImage: currentIcon) {
|
2023-03-21 00:31:18 +00:00
|
|
|
SoyuzMenuBarExtraView(printerManager: SoyuzApp.printerManager, 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)
|
|
|
|
}
|
|
|
|
}
|