alroyso 1 rok temu
rodzic
commit
f572b08388
2 zmienionych plików z 6 dodań i 2 usunięć
  1. 1 1
      lib/app/controller/tray.dart
  2. 5 1
      lib/app/controller/window.dart

+ 1 - 1
lib/app/controller/tray.dart

@@ -94,7 +94,7 @@ class TrayController extends GetxController with TrayListener {
   Future<void> handleClickShow(MenuItem menuItem) async {
     show.value = false;
     if (menuItem.checked == true) {
-      await controllers.window.closeWindow();
+      await controllers.window.hideWindow();
     } else {
       await controllers.window.showWindow();
     }

+ 5 - 1
lib/app/controller/window.dart

@@ -31,9 +31,13 @@ class WindowController extends GetxController with WindowListener {
   Future<void> closeWindow() async {
     await windowManager.close();
   }
-
+  Future<void> hideWindow() async {
+    await windowManager.hide();
+    isVisible.value = false;
+  }
   Future<void> showWindow() async {
     await windowManager.show();
+
     isVisible.value = true;
   }