1. fix cm window size onToggle Chat.

2. no need to show remote info in cm chat_page.
3. hide Chat IconButton when client unauthorized
4. update lang
This commit is contained in:
csf
2022-09-26 18:10:54 +08:00
parent 536f25f33c
commit 52c6e309ce
25 changed files with 42 additions and 17 deletions

View File

@@ -310,14 +310,15 @@ class _CmHeaderState extends State<_CmHeader>
],
),
),
Offstage(
offstage: client.isFileTransfer,
child: IconButton(
onPressed: () => checkClickTime(
client.id, () => gFFI.chatModel.toggleCMChatPage(client.id)),
icon: Icon(Icons.message_outlined),
),
)
Consumer<ServerModel>(
builder: (_, model, child) => Offstage(
offstage: !client.authorized || client.isFileTransfer,
child: IconButton(
onPressed: () => checkClickTime(client.id,
() => gFFI.chatModel.toggleCMChatPage(client.id)),
icon: Icon(Icons.message_outlined),
),
))
],
);
}

View File

@@ -62,6 +62,7 @@ class ChatPage extends StatelessWidget implements PageShape {
inputOptions: InputOptions(
sendOnEnter: true,
inputDecoration: defaultInputDecoration(
hintText: "${translate('Write a message')}...",
fillColor: Theme.of(context).backgroundColor),
sendButtonBuilder: defaultSendButton(
color: Theme.of(context)
@@ -87,7 +88,8 @@ class ChatPage extends StatelessWidget implements PageShape {
)),
);
}),
chatModel.currentID == ChatModel.clientModeID
desktopType == DesktopType.cm ||
chatModel.currentID == ChatModel.clientModeID
? SizedBox.shrink()
: Padding(
padding: EdgeInsets.all(12),

View File

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