mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
Merge pull request #4889 from 21pages/fix_remote_chat
opt remote chat page
This commit is contained in:
@@ -56,15 +56,14 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
|
||||
if (peerId != null) {
|
||||
ConnectionTypeState.init(peerId);
|
||||
tabController.onSelected = (id) {
|
||||
final remotePage = tabController.state.value.tabs
|
||||
.firstWhereOrNull((tab) => tab.key == id)
|
||||
?.page;
|
||||
final remotePage = tabController.widget(id);
|
||||
if (remotePage is RemotePage) {
|
||||
final ffi = remotePage.ffi;
|
||||
bind.setCurSessionId(sessionId: ffi.sessionId);
|
||||
}
|
||||
WindowController.fromWindowId(windowId())
|
||||
.setTitle(getWindowNameWithId(id));
|
||||
UnreadChatCountState.find(id).value = 0;
|
||||
};
|
||||
tabController.add(TabInfo(
|
||||
key: peerId,
|
||||
@@ -206,6 +205,7 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
|
||||
).paddingOnly(right: 5),
|
||||
),
|
||||
label,
|
||||
unreadMessageCountBuilder(UnreadChatCountState.find(key)),
|
||||
],
|
||||
);
|
||||
|
||||
|
||||
@@ -158,24 +158,7 @@ class ConnectionManagerState extends State<ConnectionManager> {
|
||||
message: key,
|
||||
waitDuration: Duration(seconds: 1),
|
||||
child: label),
|
||||
Obx(() => Offstage(
|
||||
offstage:
|
||||
!((client?.unreadChatMessageCount.value ?? 0) > 0),
|
||||
child: Container(
|
||||
width: 16,
|
||||
height: 16,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.red,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Center(
|
||||
child: Text(
|
||||
"${client?.unreadChatMessageCount.value ?? 0}",
|
||||
maxLines: 1,
|
||||
style: TextStyle(
|
||||
color: Colors.white, fontSize: 10)),
|
||||
),
|
||||
).marginOnly(left: 4)))
|
||||
unreadMessageCountBuilder(client?.unreadChatMessageCount),
|
||||
],
|
||||
);
|
||||
},
|
||||
|
||||
@@ -187,6 +187,10 @@ class DesktopTabController {
|
||||
state.value.tabs.clear();
|
||||
state.refresh();
|
||||
}
|
||||
|
||||
Widget? widget(String key) {
|
||||
return state.value.tabs.firstWhereOrNull((tab) => tab.key == key)?.page;
|
||||
}
|
||||
}
|
||||
|
||||
class TabThemeConf {
|
||||
|
||||
Reference in New Issue
Block a user