alroyso 1 рік тому
батько
коміт
2fba6d24a6

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

@@ -356,7 +356,7 @@ class ServiceController extends GetxController {
         }
       }
 
-      // killProcess(ClashName.name);
+      killProcess(ClashName.name);
       // if (Platform.isMacOS &&
       //     controllers.service.serviceMode.value &&
       //     controllers.config.clashCoreTunEnable.value &&

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

@@ -119,7 +119,7 @@ class TrayController extends GetxController with TrayListener {
     show.value = false;
   }
   Future<void> handleClickConsoleShow(MenuItem menuItem) async {
-    isSHow = false;
+    isSHow = true;
     if (menuItem.checked == true) {
       isShowConsole.value = true;
       controllers.global.showConsole();

+ 19 - 5
lib/app/modules/home/views/home_view.dart

@@ -168,7 +168,7 @@ class HomeView extends GetView<HomeController> {
                     ),
                   ),
                 ),
-                const SizedBox(height: 40,),
+                const SizedBox(height: 20,),
                 Center(
                   child: Row(
                     mainAxisAlignment: MainAxisAlignment.center,
@@ -211,7 +211,13 @@ class HomeView extends GetView<HomeController> {
                 //   alignment: Alignment.center,
                 //   child:,
                 // )
-                Text("版本号:$kVersion")
+                Text("版本号:$kVersion"),
+                ElevatedButton(onPressed: () async {
+                  await controllers.global.showConsole();
+                }, child: Text("显示控制台")),
+                ElevatedButton(onPressed: () async {
+                  await  controllers.global.hideConsole();
+                }, child: Text("隐藏控制台")),
               ],
             );
           })
@@ -261,11 +267,19 @@ class _UserStatusWidgetState extends State<UserStatusWidget> {
 
                 Row(
                   children: [
-                    Text(widget.username),
+                    Container(
+                      width: 150,
+                      child: Text(
+                        widget.username,
+                        overflow: TextOverflow.ellipsis,  // 使用省略号
+                        softWrap: false,  // 关闭文本自动换行
+                        maxLines: 1,  // 设置文本最大行数为 1
+                      ),
+                    ),
                     const SizedBox(width: 10,),
                     Image(
                       image: AssetImage(imagePath),
-                      width: 80,
+                      width: 60,
                       height: 30,
                     ),
                     const SizedBox(width: 10,),
@@ -273,7 +287,7 @@ class _UserStatusWidgetState extends State<UserStatusWidget> {
                       tooltip: '刷新账号状态',
                       icon: widget.isLoading
                           ? const CircularProgressIndicator()
-                          : Image.asset("assets/images/main/refresh.png"),
+                          : Image(image: AssetImage("assets/images/main/refresh.png"),width: 20,height: 20,),
                       onPressed: () {
                         // 刷新操作
                         if (!widget.isLoading) {

+ 2 - 0
macos/Flutter/GeneratedPluginRegistrant.swift

@@ -17,6 +17,7 @@ import sqflite
 import tray_manager
 import url_launcher_macos
 import window_manager
+import wl_base_help
 
 func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
   ConnectivityPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlugin"))
@@ -31,4 +32,5 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
   TrayManagerPlugin.register(with: registry.registrar(forPlugin: "TrayManagerPlugin"))
   UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
   WindowManagerPlugin.register(with: registry.registrar(forPlugin: "WindowManagerPlugin"))
+  WlBaseHelpPlugin.register(with: registry.registrar(forPlugin: "WlBaseHelpPlugin"))
 }

+ 6 - 0
macos/Podfile.lock

@@ -32,6 +32,8 @@ PODS:
     - FlutterMacOS
   - window_manager (0.2.0):
     - FlutterMacOS
+  - wl_base_help (0.0.1):
+    - FlutterMacOS
 
 DEPENDENCIES:
   - connectivity_plus_macos (from `Flutter/ephemeral/.symlinks/plugins/connectivity_plus_macos/macos`)
@@ -47,6 +49,7 @@ DEPENDENCIES:
   - tray_manager (from `Flutter/ephemeral/.symlinks/plugins/tray_manager/macos`)
   - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
   - window_manager (from `Flutter/ephemeral/.symlinks/plugins/window_manager/macos`)
+  - wl_base_help (from `Flutter/ephemeral/.symlinks/plugins/wl_base_help/macos`)
 
 SPEC REPOS:
   trunk:
@@ -80,6 +83,8 @@ EXTERNAL SOURCES:
     :path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
   window_manager:
     :path: Flutter/ephemeral/.symlinks/plugins/window_manager/macos
+  wl_base_help:
+    :path: Flutter/ephemeral/.symlinks/plugins/wl_base_help/macos
 
 SPEC CHECKSUMS:
   connectivity_plus_macos: f6e86fd000e971d361e54b5afcadc8c8fa773308
@@ -97,6 +102,7 @@ SPEC CHECKSUMS:
   tray_manager: 9064e219c56d75c476e46b9a21182087930baf90
   url_launcher_macos: d2691c7dd33ed713bf3544850a623080ec693d95
   window_manager: 3a1844359a6295ab1e47659b1a777e36773cd6e8
+  wl_base_help: f2fb433907c7c09b46c688ae9865f753f5af5974
 
 PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367
 

+ 3 - 0
windows/flutter/generated_plugin_registrant.cc

@@ -16,6 +16,7 @@
 #include <tray_manager/tray_manager_plugin.h>
 #include <url_launcher_windows/url_launcher_windows.h>
 #include <window_manager/window_manager_plugin.h>
+#include <wl_base_help/wl_base_help_plugin_c_api.h>
 
 void RegisterPlugins(flutter::PluginRegistry* registry) {
   ConnectivityPlusWindowsPluginRegisterWithRegistrar(
@@ -38,4 +39,6 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
       registry->GetRegistrarForPlugin("UrlLauncherWindows"));
   WindowManagerPluginRegisterWithRegistrar(
       registry->GetRegistrarForPlugin("WindowManagerPlugin"));
+  WlBaseHelpPluginCApiRegisterWithRegistrar(
+      registry->GetRegistrarForPlugin("WlBaseHelpPluginCApi"));
 }

+ 1 - 0
windows/flutter/generated_plugins.cmake

@@ -13,6 +13,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
   tray_manager
   url_launcher_windows
   window_manager
+  wl_base_help
 )
 
 list(APPEND FLUTTER_FFI_PLUGIN_LIST