feat: tray logic in windows

This commit is contained in:
Kingtous
2022-11-02 11:10:28 +08:00
parent 5c8639c603
commit 892869c014
3 changed files with 18 additions and 10 deletions

View File

@@ -511,11 +511,11 @@ class WindowActionPanelState extends State<WindowActionPanel>
if (res) {
// hide for all window
// note: the main window can be restored by tray icon
Future.delayed(Duration.zero, () {
Future.delayed(Duration.zero, () async {
if (widget.isMainWindow) {
windowManager.hide();
await windowManager.hide();
} else {
WindowController.fromWindowId(windowId!).hide();
await WindowController.fromWindowId(windowId!).hide();
}
});
}