mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat: hide application to dock macos (#5592)
* feat: hide application to tray macos * chore: enable reopen the app after closing it * fix: remove tray * fix: remove asset --------- Co-authored-by: Lucas.Xu <lucas.xu@appflowy.io>
This commit is contained in:
parent
8ca541bfa1
commit
d8b32168a9
@ -64,11 +64,6 @@ class InitAppWindowTask extends LaunchTask with WindowListener {
|
|||||||
await windowManager.show();
|
await windowManager.show();
|
||||||
await windowManager.focus();
|
await windowManager.focus();
|
||||||
|
|
||||||
if (PlatformExtension.isWindows) {
|
|
||||||
// Hide title bar on Windows, we implement a custom solution elsewhere
|
|
||||||
await windowManager.setTitleBarStyle(TitleBarStyle.hidden);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (position != null) {
|
if (position != null) {
|
||||||
await windowManager.setPosition(position);
|
await windowManager.setPosition(position);
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,16 @@ import FlutterMacOS
|
|||||||
@NSApplicationMain
|
@NSApplicationMain
|
||||||
class AppDelegate: FlutterAppDelegate {
|
class AppDelegate: FlutterAppDelegate {
|
||||||
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
|
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
override func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {
|
||||||
|
if !flag {
|
||||||
|
for window in sender.windows {
|
||||||
|
window.makeKeyAndOrderFront(self)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -147,6 +147,7 @@ dependencies:
|
|||||||
|
|
||||||
# BitsDojo Window for Windows
|
# BitsDojo Window for Windows
|
||||||
bitsdojo_window: ^0.1.6
|
bitsdojo_window: ^0.1.6
|
||||||
|
|
||||||
flutter_highlight: ^0.7.0
|
flutter_highlight: ^0.7.0
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
|
Loading…
Reference in New Issue
Block a user