diff --git a/Cargo.toml b/Cargo.toml index 68b489203..5bbae9fd4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -164,6 +164,7 @@ exclude = ["vdi/host", "examples/custom_plugin"] [package.metadata.winres] LegalCopyright = "Copyright © 2024 Purslane Ltd. All rights reserved." ProductName = "RustDesk" +FileDescription = "RustDesk Remote Desktop" OriginalFilename = "rustdesk.exe" [target.'cfg(target_os="windows")'.build-dependencies] diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 354702037..83f128a91 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -3082,7 +3082,7 @@ Color? disabledTextColor(BuildContext context, bool enabled) { : Theme.of(context).textTheme.titleLarge?.color?.withOpacity(0.6); } -// max 200 x 40 +// max 300 x 60 Widget? loadLogo() { bool isFound = true; final image = Image.asset( @@ -3095,9 +3095,9 @@ Widget? loadLogo() { ); if (isFound) { return Container( - constraints: BoxConstraints(maxWidth: 200, maxHeight: 40), + constraints: BoxConstraints(maxWidth: 300, maxHeight: 60), child: image, - ).marginOnly(bottom: 10); + ).marginOnly(bottom: 16); } else { return null; } diff --git a/flutter/lib/desktop/pages/connection_page.dart b/flutter/lib/desktop/pages/connection_page.dart index dc66ac2cc..2dc5161f6 100644 --- a/flutter/lib/desktop/pages/connection_page.dart +++ b/flutter/lib/desktop/pages/connection_page.dart @@ -64,6 +64,7 @@ class _OnlineStatusWidgetState extends State { @override Widget build(BuildContext context) { + final isIncomingOnly = bind.isIncomingOnly(); return Container( height: height, child: Obx(() => Row( @@ -83,7 +84,7 @@ class _OnlineStatusWidgetState extends State { ), ).marginSymmetric(horizontal: em), Container( - width: bind.isIncomingOnly() ? 240 : null, + width: isIncomingOnly ? 226 : null, child: _buildConnStatusMsg(), ), // stop @@ -101,39 +102,40 @@ class _OnlineStatusWidgetState extends State { ), // ready && public // No need to show the guide if is custom client. - if (!bind.isIncomingOnly()) 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: InkWell( - onTap: onUsePublicServerGuide, - child: Row( - children: [ - Flexible( - child: Text( - translate('setup_server_tip'), - style: TextStyle( - decoration: TextDecoration.underline, - fontSize: em), + if (!isIncomingOnly) + 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: InkWell( + onTap: onUsePublicServerGuide, + child: Row( + children: [ + Flexible( + child: Text( + translate('setup_server_tip'), + style: TextStyle( + decoration: TextDecoration.underline, + fontSize: em), + ), ), - ), - ], + ], + ), ), - ), - ) - ], + ) + ], + ), ), - ), - ) + ) ], )), - ).paddingOnly(right: bind.isIncomingOnly() ? 8 : 0); + ).paddingOnly(right: isIncomingOnly ? 8 : 0); } _buildConnStatusMsg() { @@ -258,6 +260,7 @@ class _ConnectionPageState extends State @override Widget build(BuildContext context) { + final isOutgoingOnly = bind.isOutgoingOnly(); return Column( children: [ Expanded( @@ -273,8 +276,8 @@ class _ConnectionPageState extends State Expanded(child: PeerTabPage()), ], ).paddingOnly(left: 12.0)), - if (!bind.isOutgoingOnly()) const Divider(height: 1), - if (!bind.isOutgoingOnly()) OnlineStatusWidget() + if (!isOutgoingOnly) const Divider(height: 1), + if (!isOutgoingOnly) OnlineStatusWidget() ], ); } diff --git a/flutter/lib/desktop/pages/desktop_home_page.dart b/flutter/lib/desktop/pages/desktop_home_page.dart index 1477e306c..be8f085d8 100644 --- a/flutter/lib/desktop/pages/desktop_home_page.dart +++ b/flutter/lib/desktop/pages/desktop_home_page.dart @@ -64,26 +64,49 @@ class _DesktopHomePageState extends State @override Widget build(BuildContext context) { super.build(context); + final isIncomingOnly = bind.isIncomingOnly(); return Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ buildLeftPane(context), - if (!bind.isIncomingOnly()) const VerticalDivider(width: 1), - if (!bind.isIncomingOnly()) Expanded(child: buildRightPane(context)), + if (!isIncomingOnly) const VerticalDivider(width: 1), + if (!isIncomingOnly) Expanded(child: buildRightPane(context)), ], ); } Widget buildLeftPane(BuildContext context) { + final isIncomingOnly = bind.isIncomingOnly(); + final isOutgoingOnly = bind.isOutgoingOnly(); final children = [ + if (bind.isCustomClient()) + Align( + alignment: Alignment.center, + child: MouseRegion( + cursor: SystemMouseCursors.click, + child: GestureDetector( + onTap: () { + launchUrl(Uri.parse('https://rustdesk.com')); + }, + child: Opacity( + opacity: 0.5, + child: Text( + translate("powered_by_me"), + overflow: TextOverflow.clip, + style: Theme.of(context).textTheme.bodySmall?.copyWith( + fontSize: 9, decoration: TextDecoration.underline), + )), + ), + ).marginOnly(top: 6), + ), buildTip(context), - if (!bind.isOutgoingOnly()) buildIDBoard(context), - if (!bind.isOutgoingOnly()) buildPasswordBoard(context), + if (!isOutgoingOnly) buildIDBoard(context), + if (!isOutgoingOnly) buildPasswordBoard(context), FutureBuilder( future: buildHelpCards(), builder: (_, data) { if (data.hasData) { - if (bind.isIncomingOnly()) { + if (isIncomingOnly) { if (_isInHomePage()) { Future.delayed(Duration(milliseconds: 300), () { _updateWindowSize(); @@ -98,7 +121,7 @@ class _DesktopHomePageState extends State ), buildPluginEntry(), ]; - if (bind.isIncomingOnly()) { + if (isIncomingOnly) { children.addAll([ Divider(), Container( @@ -119,7 +142,7 @@ class _DesktopHomePageState extends State return ChangeNotifierProvider.value( value: gFFI.serverModel, child: Container( - width: bind.isIncomingOnly() ? 280.0 : 200.0, + width: isIncomingOnly ? 280.0 : 200.0, color: Theme.of(context).colorScheme.background, child: DesktopScrollWrapper( scrollController: _leftPaneScrollController, @@ -133,14 +156,7 @@ class _DesktopHomePageState extends State children: children, ), ), - if (bind.isOutgoingOnly() && !bind.isDisableSettings()) - Positioned( - child: Divider(), - bottom: 26, - left: 0, - right: 0, - ), - if (bind.isOutgoingOnly() && !bind.isDisableSettings()) + if (isOutgoingOnly) Positioned( bottom: 6, left: 12, @@ -156,7 +172,7 @@ class _DesktopHomePageState extends State size: 22, ), ), - onTap: () => DesktopSettingPage.switch2page(1), + onTap: () => DesktopSettingPage.switch2page(0), onHover: (value) => _editHover.value = value, ), ), @@ -244,10 +260,6 @@ class _DesktopHomePageState extends State } Widget buildPopupMenu(BuildContext context) { - if (bind.isDisableSettings()) { - return Offstage(); - } - final textColor = Theme.of(context).textTheme.titleLarge?.color; RxBool hover = false.obs; return InkWell( @@ -351,7 +363,7 @@ class _DesktopHomePageState extends State size: 22, )).marginOnly(right: 8, top: 4), ), - onTap: () => DesktopSettingPage.switch2page(1), + onTap: () => DesktopSettingPage.switch2page(0), onHover: (value) => editHover.value = value, ), ], @@ -366,6 +378,7 @@ class _DesktopHomePageState extends State } buildTip(BuildContext context) { + final isOutgoingOnly = bind.isOutgoingOnly(); final logo = loadLogo(); return Padding( padding: @@ -380,35 +393,12 @@ class _DesktopHomePageState extends State ), Column( children: [ - Align( - alignment: Alignment.centerLeft, - child: Text( - translate("Your Desktop"), - style: Theme.of(context).textTheme.titleLarge, - // style: TextStyle( - // // color: MyTheme.color(context).text, - // fontWeight: FontWeight.normal, - // fontSize: 19), - ), - ), - if (bind.isCustomClient()) + if (!isOutgoingOnly) Align( - alignment: Alignment.centerRight, - child: MouseRegion( - cursor: SystemMouseCursors.click, - child: GestureDetector( - onTap: () { - launchUrl(Uri.parse('https://rustdesk.com')); - }, - child: Text( - translate("powered_by_me"), - overflow: TextOverflow.clip, - style: Theme.of(context) - .textTheme - .bodySmall - ?.copyWith(color: Colors.grey.withOpacity(0.7)), - ), - ), + alignment: Alignment.centerLeft, + child: Text( + translate("Your Desktop"), + style: Theme.of(context).textTheme.titleLarge, ), ), ], @@ -416,13 +406,13 @@ class _DesktopHomePageState extends State SizedBox( height: 10.0, ), - if (!bind.isOutgoingOnly()) + if (!isOutgoingOnly) Text( translate("desk_tip"), overflow: TextOverflow.clip, style: Theme.of(context).textTheme.bodySmall, ), - if (bind.isOutgoingOnly()) + if (isOutgoingOnly) Text( translate("outgoing_only_desk_tip"), overflow: TextOverflow.clip, @@ -449,9 +439,12 @@ class _DesktopHomePageState extends State if (systemError.isNotEmpty) { return buildInstallCard("", systemError, "", () {}); } + if (Platform.isWindows && !bind.isDisableInstallation()) { if (!bind.mainIsInstalled()) { - return buildInstallCard("", "install_tip", "Install", () async { + return buildInstallCard( + "", bind.isOutgoingOnly() ? "" : "install_tip", "Install", + () async { await rustDeskWinManager.closeAllSubWindows(); bind.mainGotoInstall(); }); @@ -598,14 +591,15 @@ class _DesktopHomePageState extends State ] : []) + [ - Text( - translate(content), - style: TextStyle( - height: 1.5, - color: Colors.white, - fontWeight: FontWeight.normal, - fontSize: 13), - ).marginOnly(bottom: 20) + if (content.isNotEmpty) + Text( + translate(content), + style: TextStyle( + height: 1.5, + color: Colors.white, + fontWeight: FontWeight.normal, + fontSize: 13), + ).marginOnly(bottom: 20) ] + (btnText.isNotEmpty ? [ diff --git a/flutter/lib/desktop/pages/desktop_setting_page.dart b/flutter/lib/desktop/pages/desktop_setting_page.dart index e92ec840d..543a6e6b7 100644 --- a/flutter/lib/desktop/pages/desktop_setting_page.dart +++ b/flutter/lib/desktop/pages/desktop_setting_page.dart @@ -106,10 +106,11 @@ class _DesktopSettingPageState extends State List<_TabInfo> _settingTabs() { final List<_TabInfo> settingTabs = <_TabInfo>[ _TabInfo('General', Icons.settings_outlined, Icons.settings), - if (!bind.isOutgoingOnly()) + if (!bind.isOutgoingOnly() && !bind.isDisableSettings()) _TabInfo('Security', Icons.enhanced_encryption_outlined, Icons.enhanced_encryption), - _TabInfo('Network', Icons.link_outlined, Icons.link), + if (!bind.isDisableSettings()) + _TabInfo('Network', Icons.link_outlined, Icons.link), if (!bind.isIncomingOnly()) _TabInfo( 'Display', Icons.desktop_windows_outlined, Icons.desktop_windows), @@ -125,8 +126,8 @@ class _DesktopSettingPageState extends State List _children() { final children = [ _General(), - if (!bind.isOutgoingOnly()) _Safety(), - _Network(), + if (!bind.isOutgoingOnly() && !bind.isDisableSettings()) _Safety(), + if (!bind.isDisableSettings()) _Network(), if (!bind.isIncomingOnly()) _Display(), if (!bind.isIncomingOnly() && bind.pluginFeatureIsEnabled()) _Plugin(), if (!bind.isDisableAccount()) _Account(), diff --git a/libs/portable/Cargo.toml b/libs/portable/Cargo.toml index 65e782dcb..fa4e0c654 100644 --- a/libs/portable/Cargo.toml +++ b/libs/portable/Cargo.toml @@ -18,6 +18,7 @@ winapi = { version = "0.3", features = ["winbase"] } LegalCopyright = "Copyright © 2024 Purslane Ltd. All rights reserved." ProductName = "RustDesk" OriginalFilename = "rustdesk.exe" +FileDescription = "RustDesk Remote Desktop" #ProductVersion = "" [target.'cfg(target_os="windows")'.build-dependencies] diff --git a/src/lang/en.rs b/src/lang/en.rs index 0521d637a..be32ef336 100644 --- a/src/lang/en.rs +++ b/src/lang/en.rs @@ -214,5 +214,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> = ("enable-2fa-desc", "Please set up your authenticator now. You can use an authenticator app such as Authy, Microsoft or Google Authenticator on your phone or desktop.\n\nScan the QR code with your app and enter the code that your app shows to enable two-factor authentication."), ("wrong-2fa-code", "Can't verify the code. Check that code and local time settings are correct"), ("enter-2fa-title", "Two-factor authentication"), + ("powered_by_me", "Powered by RustDesk"), ].iter().cloned().collect(); } diff --git a/src/tray.rs b/src/tray.rs index bec57d251..3f94ca04b 100644 --- a/src/tray.rs +++ b/src/tray.rs @@ -207,7 +207,7 @@ async fn start_query_session_count(sender: std::sync::mpsc::Sender) { fn load_icon_from_asset() -> Option { #[cfg(windows)] if let Ok(cmd) = std::env::current_exe() { - let path = r".\data\flutter_assets\assets\icon.ico"; + let path = r".\data\flutter_assets\assets\icon.png"; if let Some(path) = cmd.parent().map(|x| x.join(path)) { if path.exists() { if let Ok(image) = image::open(path) {