From 1cfc9b61391ce7e7091288ebef12614df56e69ae Mon Sep 17 00:00:00 2001
From: redistay <165581775+redistay@users.noreply.github.com>
Date: Tue, 2 Apr 2024 21:41:54 +0800
Subject: [PATCH 1/2] chore: fix some typos (#7585)

Signed-off-by: redistay <wujunjing@outlook.com>
---
 flutter/lib/desktop/widgets/tabbar_widget.dart       | 2 +-
 flutter/lib/models/ab_model.dart                     | 2 +-
 libs/virtual_display/dylib/src/win10/IddController.h | 2 +-
 src/common.rs                                        | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/flutter/lib/desktop/widgets/tabbar_widget.dart b/flutter/lib/desktop/widgets/tabbar_widget.dart
index 8d84de744f..76777b19f2 100644
--- a/flutter/lib/desktop/widgets/tabbar_widget.dart
+++ b/flutter/lib/desktop/widgets/tabbar_widget.dart
@@ -583,7 +583,7 @@ class WindowActionPanelState extends State<WindowActionPanel>
     mainWindowClose() async => await windowManager.hide();
     notMainWindowClose(WindowController controller) async {
       if (widget.tabController.length != 0) {
-        debugPrint("close not emtpy multiwindow from taskbar");
+        debugPrint("close not empty multiwindow from taskbar");
         if (isWindows) {
           await controller.show();
           await controller.focus();
diff --git a/flutter/lib/models/ab_model.dart b/flutter/lib/models/ab_model.dart
index 9840ded5d2..ba13c51435 100644
--- a/flutter/lib/models/ab_model.dart
+++ b/flutter/lib/models/ab_model.dart
@@ -854,7 +854,7 @@ class LegacyAb extends BaseAb {
       final resp = await http.get(Uri.parse(api), headers: authHeaders);
       statusCode = resp.statusCode;
       if (resp.body.toLowerCase() == "null") {
-        // normal reply, emtpy ab return null
+        // normal reply, empty ab return null
         tags.clear();
         tagColors.clear();
         peers.clear();
diff --git a/libs/virtual_display/dylib/src/win10/IddController.h b/libs/virtual_display/dylib/src/win10/IddController.h
index 6e87a78df1..99c5dad49e 100644
--- a/libs/virtual_display/dylib/src/win10/IddController.h
+++ b/libs/virtual_display/dylib/src/win10/IddController.h
@@ -61,7 +61,7 @@ BOOL DeviceCreate(PHSWDEVICE hSwDevice);
 /**
  * @brief Create device and set the lifetime.
  *        Only one device should be created.
- *        If device is installed ealier, this function returns FALSE.
+ *        If device is installed earlier, this function returns FALSE.
  *
  * @param lifetime [in] The lifetime to set after creating the device. NULL means do not set the lifetime.
  *                      https://learn.microsoft.com/en-us/windows/win32/api/swdevice/nf-swdevice-swdevicesetlifetime
diff --git a/src/common.rs b/src/common.rs
index 86af0f8995..e57aefe5c4 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -1682,7 +1682,7 @@ mod tests {
                     }
                 }
             }
-            // No mutliple ticks in the `interval` time.
+            // No multiple ticks in the `interval` time.
             // Values in "times" are unique and are less than normal tokio interval.
             // See previous test (test_tokio_time_interval_sleep) for comparison.
             let times2: HashSet<u128> = HashSet::from_iter(times.clone());

From 74af7ef8b23c5b4697f74c953d3ea11a1d6e46ad Mon Sep 17 00:00:00 2001
From: fufesou <fufesou@users.noreply.github.com>
Date: Tue, 2 Apr 2024 21:59:17 +0800
Subject: [PATCH 2/2] Fix. Custom client, connection status (#7586)

Signed-off-by: fufesou <shuanglongchen@yeah.net>
---
 .../lib/desktop/pages/connection_page.dart    | 136 ++++++++++--------
 1 file changed, 75 insertions(+), 61 deletions(-)

diff --git a/flutter/lib/desktop/pages/connection_page.dart b/flutter/lib/desktop/pages/connection_page.dart
index 408e0ee929..fe8e6c6427 100644
--- a/flutter/lib/desktop/pages/connection_page.dart
+++ b/flutter/lib/desktop/pages/connection_page.dart
@@ -64,76 +64,90 @@ class _OnlineStatusWidgetState extends State<OnlineStatusWidget> {
   @override
   Widget build(BuildContext context) {
     final isIncomingOnly = bind.isIncomingOnly();
-    return Container(
-      height: height,
-      child: Obx(() => Row(
-            crossAxisAlignment: CrossAxisAlignment.center,
-            children: [
-              Container(
-                height: 8,
-                width: 8,
-                decoration: BoxDecoration(
-                  borderRadius: BorderRadius.circular(4),
-                  color: _svcStopped.value ||
-                          stateGlobal.svcStatus.value == SvcStatus.connecting
-                      ? kColorWarn
-                      : (stateGlobal.svcStatus.value == SvcStatus.ready
-                          ? Color.fromARGB(255, 50, 190, 166)
-                          : Color.fromARGB(255, 224, 79, 95)),
-                ),
-              ).marginSymmetric(horizontal: em),
-              Container(
-                width: isIncomingOnly ? 226 : null,
-                child: _buildConnStatusMsg(),
-              ),
-              // stop
-              Offstage(
-                offstage: !_svcStopped.value,
-                child: InkWell(
-                        onTap: () async {
-                          await start_service(true);
-                        },
-                        child: Text(translate("Start service"),
-                            style: TextStyle(
-                                decoration: TextDecoration.underline,
-                                fontSize: em)))
-                    .marginOnly(left: em),
-              ),
-              // ready && public
-              // No need to show the guide if is custom client.
-              if (!isIncomingOnly)
+    startServiceWidget() => Offstage(
+          offstage: !_svcStopped.value,
+          child: InkWell(
+                  onTap: () async {
+                    await start_service(true);
+                  },
+                  child: Text(translate("Start service"),
+                      style: TextStyle(
+                          decoration: TextDecoration.underline, fontSize: em)))
+              .marginOnly(left: em),
+        );
+
+    setupServerWidget() => Flexible(
+          child: Offstage(
+            offstage: !(!_svcStopped.value &&
+                stateGlobal.svcStatus.value == SvcStatus.ready &&
+                _svcIsUsingPublicServer.value),
+            child: Row(
+              crossAxisAlignment: CrossAxisAlignment.center,
+              children: [
+                Text(', ', style: TextStyle(fontSize: em)),
                 Flexible(
-                  child: Offstage(
-                    offstage: !(!_svcStopped.value &&
-                        stateGlobal.svcStatus.value == SvcStatus.ready &&
-                        _svcIsUsingPublicServer.value),
+                  child: InkWell(
+                    onTap: onUsePublicServerGuide,
                     child: Row(
-                      crossAxisAlignment: CrossAxisAlignment.center,
                       children: [
-                        Text(', ', style: TextStyle(fontSize: em)),
                         Flexible(
-                          child: InkWell(
-                            onTap: onUsePublicServerGuide,
-                            child: Row(
-                              children: [
-                                Flexible(
-                                  child: Text(
-                                    translate('setup_server_tip'),
-                                    style: TextStyle(
-                                        decoration: TextDecoration.underline,
-                                        fontSize: em),
-                                  ),
-                                ),
-                              ],
-                            ),
+                          child: Text(
+                            translate('setup_server_tip'),
+                            style: TextStyle(
+                                decoration: TextDecoration.underline,
+                                fontSize: em),
                           ),
-                        )
+                        ),
                       ],
                     ),
                   ),
                 )
-            ],
-          )),
+              ],
+            ),
+          ),
+        );
+
+    basicWidget() => Row(
+          crossAxisAlignment: CrossAxisAlignment.center,
+          children: [
+            Container(
+              height: 8,
+              width: 8,
+              decoration: BoxDecoration(
+                borderRadius: BorderRadius.circular(4),
+                color: _svcStopped.value ||
+                        stateGlobal.svcStatus.value == SvcStatus.connecting
+                    ? kColorWarn
+                    : (stateGlobal.svcStatus.value == SvcStatus.ready
+                        ? Color.fromARGB(255, 50, 190, 166)
+                        : Color.fromARGB(255, 224, 79, 95)),
+              ),
+            ).marginSymmetric(horizontal: em),
+            Container(
+              width: isIncomingOnly ? 226 : null,
+              child: _buildConnStatusMsg(),
+            ),
+            // stop
+            if (!isIncomingOnly) startServiceWidget(),
+            // ready && public
+            // No need to show the guide if is custom client.
+            if (!isIncomingOnly) setupServerWidget(),
+          ],
+        );
+
+    return Container(
+      height: height,
+      child: Obx(() => isIncomingOnly
+          ? Column(
+              children: [
+                basicWidget(),
+                Align(
+                        child: startServiceWidget(),
+                        alignment: Alignment.centerLeft)
+                    .marginOnly(top: 2.0, left: 22.0),
+              ],
+            )
+          : basicWidget()),
     ).paddingOnly(right: isIncomingOnly ? 8 : 0);
   }