Merge pull request #1623 from Heap-Hop/master

fix mobile physical mouse wheel scroll
This commit is contained in:
RustDesk 2022-09-27 07:29:50 +08:00 committed by GitHub
commit 9040ada6f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 48 additions and 27 deletions

View File

@ -310,14 +310,15 @@ class _CmHeaderState extends State<_CmHeader>
], ],
), ),
), ),
Offstage( Consumer<ServerModel>(
offstage: client.isFileTransfer, builder: (_, model, child) => Offstage(
child: IconButton( offstage: !client.authorized || client.isFileTransfer,
onPressed: () => checkClickTime( child: IconButton(
client.id, () => gFFI.chatModel.toggleCMChatPage(client.id)), onPressed: () => checkClickTime(client.id,
icon: Icon(Icons.message_outlined), () => gFFI.chatModel.toggleCMChatPage(client.id)),
), icon: Icon(Icons.message_outlined),
) ),
))
], ],
); );
} }

View File

@ -62,6 +62,7 @@ class ChatPage extends StatelessWidget implements PageShape {
inputOptions: InputOptions( inputOptions: InputOptions(
sendOnEnter: true, sendOnEnter: true,
inputDecoration: defaultInputDecoration( inputDecoration: defaultInputDecoration(
hintText: "${translate('Write a message')}...",
fillColor: Theme.of(context).backgroundColor), fillColor: Theme.of(context).backgroundColor),
sendButtonBuilder: defaultSendButton( sendButtonBuilder: defaultSendButton(
color: Theme.of(context) color: Theme.of(context)
@ -87,7 +88,8 @@ class ChatPage extends StatelessWidget implements PageShape {
)), )),
); );
}), }),
chatModel.currentID == ChatModel.clientModeID desktopType == DesktopType.cm ||
chatModel.currentID == ChatModel.clientModeID
? SizedBox.shrink() ? SizedBox.shrink()
: Padding( : Padding(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),

View File

@ -325,17 +325,13 @@ class _RemotePageState extends State<RemotePage> {
}, },
onPointerSignal: (e) { onPointerSignal: (e) {
if (e is PointerScrollEvent) { if (e is PointerScrollEvent) {
var dx = e.scrollDelta.dx; var dy = 0;
var dy = e.scrollDelta.dy; if (e.scrollDelta.dy > 0) {
if (dx > 0)
dx = -1;
else if (dx < 0) dx = 1;
if (dy > 0)
dy = -1; dy = -1;
else if (dy < 0) dy = 1; } else if (e.scrollDelta.dy < 0) {
bind.sessionSendMouse( dy = 1;
id: widget.id, }
msg: '{"type": "wheel", "x": "$dx", "y": "$dy"}'); gFFI.scroll(dy);
} }
}, },
child: MouseRegion( child: MouseRegion(

View File

@ -166,12 +166,12 @@ class ChatModel with ChangeNotifier {
if (_isShowChatPage) { if (_isShowChatPage) {
_isShowChatPage = !_isShowChatPage; _isShowChatPage = !_isShowChatPage;
notifyListeners(); notifyListeners();
await windowManager.setSize(Size(400, 600)); await windowManager.setSize(Size(300, 400));
await windowManager.setAlignment(Alignment.topRight); await windowManager.setAlignment(Alignment.topRight);
} else { } else {
await windowManager.setSize(Size(800, 600)); await windowManager.setSize(Size(600, 400));
await windowManager.center();
await Future.delayed(Duration(milliseconds: 100)); await Future.delayed(Duration(milliseconds: 100));
await windowManager.setAlignment(Alignment.topRight);
_isShowChatPage = !_isShowChatPage; _isShowChatPage = !_isShowChatPage;
notifyListeners(); notifyListeners();
} }

View File

@ -351,5 +351,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Unpin menubar", "取消固定菜单栏"), ("Unpin menubar", "取消固定菜单栏"),
("Enable LAN Discovery", "允许局域网发现"), ("Enable LAN Discovery", "允许局域网发现"),
("Deny LAN Discovery", "拒绝局域网发现"), ("Deny LAN Discovery", "拒绝局域网发现"),
("Write a message", "输入聊天消息"),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -351,5 +351,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Unpin menubar", "Odepnout panel nabídek"), ("Unpin menubar", "Odepnout panel nabídek"),
("Enable LAN Discovery", ""), ("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""), ("Deny LAN Discovery", ""),
("Write a message", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -351,5 +351,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Unpin menubar", "Frigør menulinjen"), ("Unpin menubar", "Frigør menulinjen"),
("Enable LAN Discovery", ""), ("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""), ("Deny LAN Discovery", ""),
("Write a message", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -351,5 +351,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Unpin menubar", "Menüleiste lösen"), ("Unpin menubar", "Menüleiste lösen"),
("Enable LAN Discovery", ""), ("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""), ("Deny LAN Discovery", ""),
("Write a message", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -351,5 +351,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Unpin menubar", "Malfiksi menubreton"), ("Unpin menubar", "Malfiksi menubreton"),
("Enable LAN Discovery", ""), ("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""), ("Deny LAN Discovery", ""),
("Write a message", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -351,5 +351,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Unpin menubar", "Desbloquear barra de menú"), ("Unpin menubar", "Desbloquear barra de menú"),
("Enable LAN Discovery", ""), ("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""), ("Deny LAN Discovery", ""),
("Write a message", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -351,5 +351,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Unpin menubar", "Détacher la barre de menu"), ("Unpin menubar", "Détacher la barre de menu"),
("Enable LAN Discovery", ""), ("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""), ("Deny LAN Discovery", ""),
("Write a message", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -351,5 +351,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Unpin menubar", "Menüsor rögzítésének feloldása"), ("Unpin menubar", "Menüsor rögzítésének feloldása"),
("Enable LAN Discovery", ""), ("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""), ("Deny LAN Discovery", ""),
("Write a message", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -351,5 +351,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Unpin menubar", "Unpin menubar"), ("Unpin menubar", "Unpin menubar"),
("Enable LAN Discovery", ""), ("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""), ("Deny LAN Discovery", ""),
("Write a message", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -351,5 +351,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Unpin menubar", "Sblocca la barra dei menu"), ("Unpin menubar", "Sblocca la barra dei menu"),
("Enable LAN Discovery", ""), ("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""), ("Deny LAN Discovery", ""),
("Write a message", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -351,5 +351,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Unpin menubar", "メニューバーのピン留めを外す"), ("Unpin menubar", "メニューバーのピン留めを外す"),
("Enable LAN Discovery", ""), ("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""), ("Deny LAN Discovery", ""),
("Write a message", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -351,5 +351,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Unpin menubar", "메뉴 모음 고정 해제"), ("Unpin menubar", "메뉴 모음 고정 해제"),
("Enable LAN Discovery", ""), ("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""), ("Deny LAN Discovery", ""),
("Write a message", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -351,5 +351,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Unpin menubar", "Мәзір жолағын босату"), ("Unpin menubar", "Мәзір жолағын босату"),
("Enable LAN Discovery", ""), ("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""), ("Deny LAN Discovery", ""),
("Write a message", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -351,5 +351,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Unpin menubar", "Odepnij pasek menu"), ("Unpin menubar", "Odepnij pasek menu"),
("Enable LAN Discovery", ""), ("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""), ("Deny LAN Discovery", ""),
("Write a message", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -351,5 +351,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Unpin menubar", "Desenganxa la barra de menús"), ("Unpin menubar", "Desenganxa la barra de menús"),
("Enable LAN Discovery", ""), ("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""), ("Deny LAN Discovery", ""),
("Write a message", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -351,5 +351,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Unpin menubar", ""), ("Unpin menubar", ""),
("Enable LAN Discovery", ""), ("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""), ("Deny LAN Discovery", ""),
("Write a message", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -351,5 +351,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Unpin menubar", "Открепить строку меню"), ("Unpin menubar", "Открепить строку меню"),
("Enable LAN Discovery", ""), ("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""), ("Deny LAN Discovery", ""),
("Write a message", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -351,5 +351,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Unpin menubar", "Uvoľniť panel s ponukami"), ("Unpin menubar", "Uvoľniť panel s ponukami"),
("Enable LAN Discovery", ""), ("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""), ("Deny LAN Discovery", ""),
("Write a message", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -351,5 +351,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Unpin menubar", ""), ("Unpin menubar", ""),
("Enable LAN Discovery", ""), ("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""), ("Deny LAN Discovery", ""),
("Write a message", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -351,5 +351,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Unpin menubar", "Menü çubuğunun sabitlemesini kaldır"), ("Unpin menubar", "Menü çubuğunun sabitlemesini kaldır"),
("Enable LAN Discovery", ""), ("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""), ("Deny LAN Discovery", ""),
("Write a message", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -327,14 +327,14 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Account", "賬戶"), ("Account", "賬戶"),
("Theme", "主題"), ("Theme", "主題"),
("Dark Theme", "暗黑主題"), ("Dark Theme", "暗黑主題"),
("Dark", ""), ("Dark", "黑暗"),
("Light", ""), ("Light", "明亮"),
("Follow System", ""), ("Follow System", "跟隨系統"),
("Enable hardware codec", "使用硬件編解碼"), ("Enable hardware codec", "使用硬件編解碼"),
("Unlock Security Settings", "解鎖安全設置"), ("Unlock Security Settings", "解鎖安全設置"),
("Enable Audio", "允許傳輸音頻"), ("Enable Audio", "允許傳輸音頻"),
("Temporary Password Length", "临时密码长"), ("Temporary Password Length", "臨時密碼長"),
("Unlock Network Settings", "臨時密碼長度"), ("Unlock Network Settings", "解鎖網絡設置"),
("Server", "服務器"), ("Server", "服務器"),
("Direct IP Access", "IP直接訪問"), ("Direct IP Access", "IP直接訪問"),
("Proxy", "代理"), ("Proxy", "代理"),
@ -351,5 +351,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Unpin menubar", "取消固定菜單欄"), ("Unpin menubar", "取消固定菜單欄"),
("Enable LAN Discovery", "允許局域網發現"), ("Enable LAN Discovery", "允許局域網發現"),
("Deny LAN Discovery", "拒絕局域網發現"), ("Deny LAN Discovery", "拒絕局域網發現"),
("Write a message", "輸入聊天消息"),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View File

@ -351,5 +351,6 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Unpin menubar", "Bỏ ghim thanh menu"), ("Unpin menubar", "Bỏ ghim thanh menu"),
("Enable LAN Discovery", ""), ("Enable LAN Discovery", ""),
("Deny LAN Discovery", ""), ("Deny LAN Discovery", ""),
("Write a message", ""),
].iter().cloned().collect(); ].iter().cloned().collect();
} }