set image center when remote resolution is changed

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-01-10 17:13:40 +08:00
parent c7fd38ed23
commit a3643f53bf
8 changed files with 34 additions and 22 deletions

View File

@@ -1,6 +1,7 @@
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:flutter_hbb/consts.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:flutter_hbb/models/platform_model.dart';
@@ -170,14 +171,14 @@ RxString KBLayoutType = ''.obs;
String getLocalPlatformForKBLayoutType(String peerPlatform) {
String localPlatform = '';
if (peerPlatform != 'Mac OS') {
if (peerPlatform != kPeerPlatformMacOS) {
return localPlatform;
}
if (Platform.isWindows) {
localPlatform = 'Windows';
localPlatform = kPeerPlatformWindows;
} else if (Platform.isLinux) {
localPlatform = 'Linux';
localPlatform = kPeerPlatformLinux;
}
// to-do: web desktop support ?
return localPlatform;

View File

@@ -589,7 +589,7 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
}
displayMenu.add(MenuEntryDivider());
if (perms['keyboard'] != false) {
if (pi.platform == 'Linux' || pi.sasEnabled) {
if (pi.platform == kPeerPlatformLinux || pi.sasEnabled) {
displayMenu.add(MenuEntryButton<String>(
childBuilder: (TextStyle? style) => Text(
'${translate("Insert")} Ctrl + Alt + Del',
@@ -604,9 +604,9 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
}
}
if (perms['restart'] != false &&
(pi.platform == 'Linux' ||
pi.platform == 'Windows' ||
pi.platform == 'Mac OS')) {
(pi.platform == kPeerPlatformLinux ||
pi.platform == kPeerPlatformWindows ||
pi.platform == kPeerPlatformMacOS)) {
displayMenu.add(MenuEntryButton<String>(
childBuilder: (TextStyle? style) => Text(
translate('Restart Remote Device'),
@@ -633,7 +633,7 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
dismissOnClicked: true,
));
if (pi.platform == 'Windows') {
if (pi.platform == kPeerPlatformWindows) {
displayMenu.add(MenuEntryButton<String>(
childBuilder: (TextStyle? style) => Obx(() => Text(
translate(
@@ -1157,7 +1157,7 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
}
if (Platform.isWindows &&
pi.platform == 'Windows' &&
pi.platform == kPeerPlatformWindows &&
perms['file'] != false) {
displayMenu.add(_createSwitchMenuEntry(
'Allow file copy and paste', 'enable-file-transfer', padding, true));