feat: add desktop system tray support (#120)

This commit is contained in:
Li Wei authored and GitHub committed 2023-06-07 21:50:40 +08:00
1 parent 0100f0131d
commit b3e372326f
17 files changed
+203 -7

No files matched your search

+13
View File
@@ -4,6 +4,19 @@ import FlutterMacOS
@NSApplicationMain
class AppDelegate: FlutterAppDelegate {
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
return false
}
override func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {
if !flag {
for window in NSApp.windows {
if !window.isVisible {
window.setIsVisible(true)
}
window.makeKeyAndOrderFront(self)
NSApp.activate(ignoringOtherApps: true)
}
}
return true
}
}