mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-19 08:14:21 +01:00
feat: support macOS menubar (#976)
* feat: macOS menubar * feat: Dynamic NavigateMenuItems * fix: simplify shortcut config * fix: Simplify the code * fix: More suitable tab name
This commit is contained in:
@@ -10,4 +10,19 @@ class AppDelegate: FlutterAppDelegate {
|
||||
override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
|
||||
return true
|
||||
}
|
||||
|
||||
override func applicationDidFinishLaunching(_ notification: Notification) {
|
||||
if let controller = mainFlutterWindow?.contentViewController as? FlutterViewController {
|
||||
let channel = FlutterMethodChannel(name: "about", binaryMessenger: controller.engine.binaryMessenger)
|
||||
channel.setMethodCallHandler { (call: FlutterMethodCall, result: @escaping FlutterResult) in
|
||||
if call.method == "showAboutPanel" {
|
||||
NSApp.orderFrontStandardAboutPanel(nil)
|
||||
result(nil)
|
||||
} else {
|
||||
result(FlutterMethodNotImplemented)
|
||||
}
|
||||
}
|
||||
}
|
||||
super.applicationDidFinishLaunching(notification)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user