fix env support
This commit is contained in:
parent
7b156f757e
commit
e3958d7d92
@ -42,7 +42,7 @@ struct punchnetApp: App {
|
||||
}
|
||||
|
||||
var body: some Scene {
|
||||
Window("Punchnet", id: "main") {
|
||||
Window("Punchnet", id: "main-\(SystemConfig.env.rawValue)") {
|
||||
AppRootView()
|
||||
.navigationTitle("")
|
||||
.environment(self.appContext)
|
||||
@ -65,7 +65,7 @@ struct punchnetApp: App {
|
||||
.defaultPosition(.center)
|
||||
.windowStyle(.hiddenTitleBar)
|
||||
|
||||
Window("settings", id: "settings") {
|
||||
Window("settings", id: "settings-\(SystemConfig.env.rawValue)") {
|
||||
SettingsView()
|
||||
.environment(self.appContext)
|
||||
.frame(width: 750, height: 450)
|
||||
@ -74,7 +74,7 @@ struct punchnetApp: App {
|
||||
.defaultPosition(.center)
|
||||
.windowStyle(.hiddenTitleBar)
|
||||
|
||||
MenuBarExtra("Punchnet", image: "logo_32") {
|
||||
MenuBarExtra("Punchnet-\(SystemConfig.env.rawValue)", image: "logo_32") {
|
||||
MainMenuBar()
|
||||
.environment(appContext)
|
||||
}
|
||||
@ -87,11 +87,7 @@ struct punchnetApp: App {
|
||||
class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
|
||||
func applicationWillFinishLaunching(_ notification: Notification) {
|
||||
// let settings = SCDynamicStoreCopyProxies(nil)
|
||||
// let proxies = settings as? [String: Any] ?? [:]
|
||||
// for (key, value) in proxies {
|
||||
// print("\(key): \(value)")
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
func applicationShouldTerminate(_ sender: NSApplication) -> NSApplication.TerminateReply {
|
||||
|
||||
@ -48,14 +48,15 @@ struct MainMenuBar: View {
|
||||
Divider()
|
||||
|
||||
Button("打开控制面板") {
|
||||
openWindow(id: "main")
|
||||
openWindow(id: "main-\(SystemConfig.env.rawValue)")
|
||||
NSApp.activate(ignoringOtherApps: true)
|
||||
print("call me open main")
|
||||
}
|
||||
|
||||
SettingsLink {
|
||||
Text("设置")
|
||||
Button("设置") {
|
||||
openWindow(id: "settings-\(SystemConfig.env.rawValue)")
|
||||
NSApp.activate(ignoringOtherApps: true)
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
|
||||
Divider()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user