Merge pull request #4946 from 21pages/fix

revert cm show
This commit is contained in:
RustDesk 2023-07-11 10:17:45 +08:00 committed by GitHub
commit 21a172478c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 12 deletions

View File

@ -2212,8 +2212,7 @@ Widget unreadMessageCountBuilder(RxInt? count,
)));
}
Widget unreadTopRightBuilder(RxInt? count,
{Widget? icon, double? size, double? fontSize}) {
Widget unreadTopRightBuilder(RxInt? count, {Widget? icon}) {
return Stack(
children: [
icon ?? Icon(Icons.chat),

View File

@ -185,14 +185,19 @@ class ConnectionManagerState extends State<ConnectionManager> {
child:
ChatPage(type: ChatPageType.desktopCM)),
),
flex: (kConnectionManagerWindowSizeOpenChat.width -
kConnectionManagerWindowSizeClosedChat
.width)
.toInt(),
)
: Expanded(child: Container()),
: Offstage(),
),
SizedBox(
width: kConnectionManagerWindowSizeClosedChat.width -
10, // 10 is from overflow
child: pageView,
)
Expanded(
child: pageView,
flex: kConnectionManagerWindowSizeClosedChat.width
.toInt() -
4 // prevent stretch of the page view when chat is open,
),
],
),
),

View File

@ -277,16 +277,16 @@ class ChatModel with ChangeNotifier {
gFFI.chatModel.changeCurrentKey(key);
}
if (_isShowCMChatPage) {
await windowManager.setSizeAlignment(
kConnectionManagerWindowSizeClosedChat, Alignment.topRight);
await windowManager.show();
_isShowCMChatPage = !_isShowCMChatPage;
notifyListeners();
await windowManager.show();
await windowManager.setSizeAlignment(
kConnectionManagerWindowSizeClosedChat, Alignment.topRight);
} else {
requestChatInputFocus();
await windowManager.show();
await windowManager.setSizeAlignment(
kConnectionManagerWindowSizeOpenChat, Alignment.topRight);
await windowManager.show();
_isShowCMChatPage = !_isShowCMChatPage;
notifyListeners();
}