diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 50e6beac5..fce2c852f 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -368,7 +368,7 @@ class MyTheme { static void changeDarkMode(ThemeMode mode) async { Get.changeThemeMode(mode); - if (desktopType == DesktopType.main) { + if (desktopType == DesktopType.main || isAndroid || isIOS) { if (mode == ThemeMode.system) { await bind.mainSetLocalOption(key: kCommConfKeyTheme, value: ''); } else { diff --git a/flutter/lib/consts.dart b/flutter/lib/consts.dart index 95e4d17e7..e2a3c6f0b 100644 --- a/flutter/lib/consts.dart +++ b/flutter/lib/consts.dart @@ -14,7 +14,10 @@ const String kPeerPlatformAndroid = "Android"; /// [kAppTypeMain] used by 'Desktop Main Page' , 'Mobile (Client and Server)', "Install Page" const String kAppTypeMain = "main"; + +/// [kAppTypeConnectionManager] only for 'Desktop CM Page' const String kAppTypeConnectionManager = "cm"; + const String kAppTypeDesktopRemote = "remote"; const String kAppTypeDesktopFileTransfer = "file transfer"; const String kAppTypeDesktopPortForward = "port forward"; diff --git a/flutter/lib/models/server_model.dart b/flutter/lib/models/server_model.dart index 40aa68d20..dde452814 100644 --- a/flutter/lib/models/server_model.dart +++ b/flutter/lib/models/server_model.dart @@ -263,8 +263,11 @@ class ServerModel with ChangeNotifier { toggleInput() { if (_inputOk) { parent.target?.invokeMethod("stop_input"); + bind.mainSetOption(key: "enable-keyboard", value: 'N'); } else { if (parent.target != null) { + /// the result of toggle-on depends on user actions in the settings page. + /// handle result, see [ServerModel.changeStatue] showInputWarnAlert(parent.target!); } } diff --git a/src/flutter.rs b/src/flutter.rs index a39b992bf..354e418eb 100644 --- a/src/flutter.rs +++ b/src/flutter.rs @@ -26,8 +26,14 @@ use std::{ sync::{Arc, RwLock}, }; +/// tag "main" for [Desktop Main Page] and [Mobile (Client and Server)] (the mobile don't need multiple windows, only one global event stream is needed) +/// tag "cm" only for [Desktop CM Page] pub(super) const APP_TYPE_MAIN: &str = "main"; +#[cfg(not(any(target_os = "android", target_os = "ios")))] pub(super) const APP_TYPE_CM: &str = "cm"; +#[cfg(any(target_os = "android", target_os = "ios"))] +pub(super) const APP_TYPE_CM: &str = "main"; + pub(super) const APP_TYPE_DESKTOP_REMOTE: &str = "remote"; pub(super) const APP_TYPE_DESKTOP_FILE_TRANSFER: &str = "file transfer"; pub(super) const APP_TYPE_DESKTOP_PORT_FORWARD: &str = "port forward"; diff --git a/src/lang/cn.rs b/src/lang/cn.rs index 163c50e1b..9a8f176a2 100644 --- a/src/lang/cn.rs +++ b/src/lang/cn.rs @@ -349,7 +349,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Security", "安全"), ("Theme", "主题"), ("Dark Theme", "暗黑主题"), - ("Light Theme", ""), + ("Light Theme", "明亮主题"), ("Dark", "黑暗"), ("Light", "明亮"), ("Follow System", "跟随系统"), diff --git a/src/lang/tw.rs b/src/lang/tw.rs index 72a38afcd..3cf05689a 100644 --- a/src/lang/tw.rs +++ b/src/lang/tw.rs @@ -349,7 +349,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("Security", "安全"), ("Theme", "主題"), ("Dark Theme", "暗黑主題"), - ("Light Theme", ""), + ("Light Theme", "明亮主題"), ("Dark", "黑暗"), ("Light", "明亮"), ("Follow System", "跟隨系統"),