From b0f22d869381e41b4230f00b52f73705149639b8 Mon Sep 17 00:00:00 2001 From: 21pages Date: Sat, 8 Jul 2023 11:09:50 +0800 Subject: [PATCH] fix cm unread and add vertical divider Signed-off-by: 21pages --- flutter/lib/desktop/pages/server_page.dart | 14 +++++++++++++- flutter/lib/models/server_model.dart | 8 +------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/flutter/lib/desktop/pages/server_page.dart b/flutter/lib/desktop/pages/server_page.dart index 51e736f7b..f5d5fa4f4 100644 --- a/flutter/lib/desktop/pages/server_page.dart +++ b/flutter/lib/desktop/pages/server_page.dart @@ -104,6 +104,12 @@ class ConnectionManagerState extends State { final client = gFFI.serverModel.clients.firstWhereOrNull((e) => e.id == client_id); if (client != null) { + if (client.unreadChatMessageCount.value > 0) { + Future.delayed(Duration.zero, () { + client.unreadChatMessageCount.value = 0; + gFFI.chatModel.showChatPage(client.id); + }); + } windowManager.setTitle(getWindowNameWithId(client.peerId)); } } @@ -168,7 +174,13 @@ class ConnectionManagerState extends State { builder: (_, model, child) => model.isShowCMChatPage ? Expanded( child: buildRemoteBlock( - child: ChatPage(), + child: Container( + decoration: BoxDecoration( + border: Border( + right: BorderSide( + color: Theme.of(context) + .dividerColor))), + child: ChatPage()), ), flex: (kConnectionManagerWindowSizeOpenChat.width - kConnectionManagerWindowSizeClosedChat diff --git a/flutter/lib/models/server_model.dart b/flutter/lib/models/server_model.dart index cd0f52f39..97f0e706c 100644 --- a/flutter/lib/models/server_model.dart +++ b/flutter/lib/models/server_model.dart @@ -462,13 +462,7 @@ class ServerModel with ChangeNotifier { key: client.id.toString(), label: client.name, closable: false, - onTap: () { - if (client.unreadChatMessageCount.value > 0) { - client.unreadChatMessageCount.value = 0; - final chatModel = parent.target!.chatModel; - chatModel.showChatPage(client.id); - } - }, + onTap: () {}, page: desktop.buildConnectionCard(client))); Future.delayed(Duration.zero, () async { if (!hideCm) window_on_top(null);