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