desktop cm: auto focus & merge setSizeAlignment

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2022-11-05 10:35:56 +08:00
parent e7ac6eb0d2
commit 4f7af964c6
4 changed files with 7 additions and 14 deletions

View File

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