feat: new ui (#1455)

This commit is contained in:
Levi authored and GitHub committed 2026-09-05 19:53:41 +08:00
1 parent 3be8db664c
commit 177c225f16
742 files changed
+59951 -5934

No files matched your search

+12 -16
View File
@@ -4,17 +4,17 @@ import app_links
@main
class AppDelegate: FlutterAppDelegate {
public override func application(_ application: NSApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([any NSUserActivityRestoring]) -> Void) -> Bool {
override func application(
_ application: NSApplication,
continue userActivity: NSUserActivity,
restorationHandler: @escaping ([any NSUserActivityRestoring]) -> Void
) -> Bool {
guard let url = AppLinks.shared.getUniversalLink(userActivity) else {
return false
}
AppLinks.shared.handleLink(link: url.absoluteString)
return false // Returning true will stop the propagation to other packages
// Keep propagating the activity to other registered plugins.
return false
}
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
@@ -32,23 +32,19 @@ class AppDelegate: FlutterAppDelegate {
window.setIsVisible(true)
}
window.makeKeyAndOrderFront(self)
NSApp.activate(ignoringOtherApps: true)
}
NSApp.activate(ignoringOtherApps: true)
}
return true
}
override func application(_ sender: NSApplication, openFile filename: String) -> Bool {
let url = URL(fileURLWithPath: filename)
AppLinks.shared.handleLink(link: url.absoluteString)
return false;
AppLinks.shared.handleLink(link: URL(fileURLWithPath: filename).absoluteString)
return true
}
override func application(_ application: NSApplication, open urls: [URL]) {
// Only handle the first file
if(urls.isEmpty) {
return
}
AppLinks.shared.handleLink(link: urls.first!.absoluteString)
guard let url = urls.first else { return }
AppLinks.shared.handleLink(link: url.absoluteString)
}
}