fix formatId, right panel button style, default windows size (windows,

Linux, no idea about Mac, need to check with xcode)
This commit is contained in:
rustdesk 2022-09-20 19:31:32 +08:00
parent 13fe2164d4
commit 3101c4e119
6 changed files with 40 additions and 33 deletions

View File

@ -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") {

View File

@ -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;

View File

@ -215,7 +215,7 @@ class _ConnectionPageState extends State<ConnectionPage> {
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<ConnectionPage> {
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),
)),
),
),
],

View File

@ -290,7 +290,7 @@ class _DesktopHomePageState extends State<DesktopHomePage>
@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<DesktopHomePage>
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<bool> loginDialog() async {
debugPrint("$resp");
completer.complete(true);
} catch (err) {
// ignore: avoid_print
print(err.toString());
debugPrint(err.toString());
cancel();
return;
}

View File

@ -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();

View File

@ -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;