diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index dfe96c903..f268286a9 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -760,8 +760,9 @@ class PermissionManager { if (isDesktop) { return Future.value(true); } - if (!permissions.contains(type)) + if (!permissions.contains(type)) { return Future.error("Wrong permission!$type"); + } return gFFI.invokeMethod("check_permission", type); } @@ -769,8 +770,9 @@ class PermissionManager { if (isDesktop) { return Future.value(true); } - if (!permissions.contains(type)) + if (!permissions.contains(type)) { return Future.error("Wrong permission!$type"); + } gFFI.invokeMethod("request_permission", type); if (type == "ignore_battery_optimizations") { diff --git a/flutter/lib/common/formatter/id_formatter.dart b/flutter/lib/common/formatter/id_formatter.dart index c7ce14da4..a9e4893a6 100644 --- a/flutter/lib/common/formatter/id_formatter.dart +++ b/flutter/lib/common/formatter/id_formatter.dart @@ -33,6 +33,7 @@ class IDTextInputFormatter extends TextInputFormatter { String formatID(String id) { String id2 = id.replaceAll(' ', ''); + if (int.tryParse(id2) == null) return id; String newID = ''; if (id2.length <= 3) { newID = id2; diff --git a/flutter/lib/desktop/pages/connection_page.dart b/flutter/lib/desktop/pages/connection_page.dart index 5c127354e..f7fdd3e5f 100644 --- a/flutter/lib/desktop/pages/connection_page.dart +++ b/flutter/lib/desktop/pages/connection_page.dart @@ -215,7 +215,7 @@ class _ConnectionPageState extends State { onConnect(isFileTransfer: true); }, child: Container( - height: 24, + height: 27, alignment: Alignment.center, decoration: BoxDecoration( color: ftPressed.value @@ -252,31 +252,36 @@ class _ConnectionPageState extends State { onTapCancel: () => connPressed.value = false, onHover: (value) => connHover.value = value, onTap: onConnect, - child: Container( - height: 24, - decoration: BoxDecoration( - color: connPressed.value - ? MyTheme.accent - : MyTheme.button, - border: Border.all( - color: connPressed.value - ? MyTheme.accent - : connHover.value - ? MyTheme.hoverBorder - : MyTheme.button, + child: ConstrainedBox( + constraints: BoxConstraints( + minWidth: 80.0, ), - borderRadius: BorderRadius.circular(5), - ), - child: Center( - child: Text( - translate( - "Connect", + child: Container( + height: 27, + decoration: BoxDecoration( + color: connPressed.value + ? MyTheme.accent + : MyTheme.button, + border: Border.all( + color: connPressed.value + ? MyTheme.accent + : connHover.value + ? MyTheme.hoverBorder + : MyTheme.button, + ), + borderRadius: BorderRadius.circular(5), ), - style: TextStyle( - fontSize: 12, color: MyTheme.color(context).bg), - ), - ).marginSymmetric(horizontal: 12), - ), + child: Center( + child: Text( + translate( + "Connect", + ), + style: TextStyle( + fontSize: 12, + color: MyTheme.color(context).bg), + ), + ).marginSymmetric(horizontal: 12), + )), ), ), ], diff --git a/flutter/lib/desktop/pages/desktop_home_page.dart b/flutter/lib/desktop/pages/desktop_home_page.dart index b574900fe..edae7deeb 100644 --- a/flutter/lib/desktop/pages/desktop_home_page.dart +++ b/flutter/lib/desktop/pages/desktop_home_page.dart @@ -290,7 +290,7 @@ class _DesktopHomePageState extends State @override void onTrayMenuItemClick(MenuItem menuItem) { - print('click ${menuItem.key}'); + debugPrint('click ${menuItem.key}'); switch (menuItem.key) { case "quit": exit(0); @@ -308,8 +308,8 @@ class _DesktopHomePageState extends State trayManager.addListener(this); windowManager.addListener(this); rustDeskWinManager.setMethodHandler((call, fromWindowId) async { - print( - "call ${call.method} with args ${call.arguments} from window ${fromWindowId}"); + debugPrint( + "call ${call.method} with args ${call.arguments} from window $fromWindowId"); if (call.method == "main_window_on_top") { window_on_top(null); } @@ -373,8 +373,7 @@ Future loginDialog() async { debugPrint("$resp"); completer.complete(true); } catch (err) { - // ignore: avoid_print - print(err.toString()); + debugPrint(err.toString()); cancel(); return; } diff --git a/flutter/linux/my_application.cc b/flutter/linux/my_application.cc index deea3f549..6d101687b 100644 --- a/flutter/linux/my_application.cc +++ b/flutter/linux/my_application.cc @@ -51,7 +51,7 @@ static void my_application_activate(GApplication* application) { // auto bdw = bitsdojo_window_from(window); // <--- add this line // bdw->setCustomFrame(true); // <-- add this line - gtk_window_set_default_size(window, 1280, 720); // <-- comment this line + gtk_window_set_default_size(window, 800, 600); // <-- comment this line gtk_widget_show(GTK_WIDGET(window)); g_autoptr(FlDartProject) project = fl_dart_project_new(); diff --git a/flutter/windows/runner/main.cpp b/flutter/windows/runner/main.cpp index f84fc1861..0724ace8a 100644 --- a/flutter/windows/runner/main.cpp +++ b/flutter/windows/runner/main.cpp @@ -52,7 +52,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, FlutterWindow window(project); Win32Window::Point origin(10, 10); - Win32Window::Size size(1280, 720); + Win32Window::Size size(800, 600); if (!window.CreateAndShow(L"flutter_hbb", origin, size)) { return EXIT_FAILURE;