From d7ef3df2b363ff98d998363b5f5eaf2a7d62326a Mon Sep 17 00:00:00 2001 From: 21pages Date: Tue, 11 Jul 2023 10:01:56 +0800 Subject: [PATCH 1/2] Revert "try fix linux cm abnormal show" This reverts commit 193426a3c10cb063db644068ac6f0df43c197341. --- flutter/lib/desktop/pages/server_page.dart | 2 +- flutter/lib/models/chat_model.dart | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/flutter/lib/desktop/pages/server_page.dart b/flutter/lib/desktop/pages/server_page.dart index 53088f69e..b1ebf9d71 100644 --- a/flutter/lib/desktop/pages/server_page.dart +++ b/flutter/lib/desktop/pages/server_page.dart @@ -186,7 +186,7 @@ class ConnectionManagerState extends State { ChatPage(type: ChatPageType.desktopCM)), ), ) - : Expanded(child: Container()), + : Offstage(), ), SizedBox( width: kConnectionManagerWindowSizeClosedChat.width - diff --git a/flutter/lib/models/chat_model.dart b/flutter/lib/models/chat_model.dart index 48476951f..fe1de2512 100644 --- a/flutter/lib/models/chat_model.dart +++ b/flutter/lib/models/chat_model.dart @@ -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(); } From 3db0f90af9a2217f1db857c5c07d7b837c6278a4 Mon Sep 17 00:00:00 2001 From: 21pages Date: Tue, 11 Jul 2023 10:05:31 +0800 Subject: [PATCH 2/2] revert cm fixed width Signed-off-by: 21pages --- flutter/lib/common.dart | 3 +-- flutter/lib/desktop/pages/server_page.dart | 15 ++++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 314b1f9d3..4d25e6d0d 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -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), diff --git a/flutter/lib/desktop/pages/server_page.dart b/flutter/lib/desktop/pages/server_page.dart index b1ebf9d71..f1e35364c 100644 --- a/flutter/lib/desktop/pages/server_page.dart +++ b/flutter/lib/desktop/pages/server_page.dart @@ -185,14 +185,19 @@ class ConnectionManagerState extends State { child: ChatPage(type: ChatPageType.desktopCM)), ), + flex: (kConnectionManagerWindowSizeOpenChat.width - + kConnectionManagerWindowSizeClosedChat + .width) + .toInt(), ) : 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, + ), ], ), ),