From 73982f48d6614fa687a6128135a34c2e45336fe5 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Tue, 6 Aug 2024 20:00:13 +0800 Subject: [PATCH] :bug: Bug fixes --- lib/widgets/chat/chat_event.dart | 8 +++++--- lib/widgets/chat/chat_event_action_log.dart | 6 +++++- lib/widgets/chat/chat_event_message.dart | 4 +++- lib/widgets/chat/chat_message_input.dart | 2 ++ lib/widgets/posts/post_item.dart | 8 ++++---- 5 files changed, 19 insertions(+), 9 deletions(-) diff --git a/lib/widgets/chat/chat_event.dart b/lib/widgets/chat/chat_event.dart index 2f127b3..75f26e5 100644 --- a/lib/widgets/chat/chat_event.dart +++ b/lib/widgets/chat/chat_event.dart @@ -50,10 +50,10 @@ class ChatEvent extends StatelessWidget { return Row( children: [ Icon( - Icons.attachment, - size: 18, + Icons.file_copy, + size: 15, color: unFocusColor, - ).paddingOnly(right: 6), + ).paddingOnly(right: 5), Text( 'attachmentHint'.trParams( {'count': attachments.length.toString()}, @@ -221,6 +221,8 @@ class ChatEvent extends StatelessWidget { ], ), _buildContent().paddingOnly(left: 0.5), + _buildAttachment(context, isMinimal: true) + .paddingOnly(left: 0), ], ), ), diff --git a/lib/widgets/chat/chat_event_action_log.dart b/lib/widgets/chat/chat_event_action_log.dart index 913a132..f3e6ec4 100644 --- a/lib/widgets/chat/chat_event_action_log.dart +++ b/lib/widgets/chat/chat_event_action_log.dart @@ -31,7 +31,11 @@ class ChatEventMessageActionLog extends StatelessWidget { ).paddingOnly( left: isQuote ? 0 : (isMerged ? 64 : 12), top: 2, - bottom: isHasMerged ? 2 : 0, + bottom: isQuote + ? 0 + : isHasMerged + ? 2 + : 0, ), ); } diff --git a/lib/widgets/chat/chat_event_message.dart b/lib/widgets/chat/chat_event_message.dart index 5e0764d..1fb0097 100644 --- a/lib/widgets/chat/chat_event_message.dart +++ b/lib/widgets/chat/chat_event_message.dart @@ -67,7 +67,9 @@ class ChatEventMessage extends StatelessWidget { left: isQuote ? 0 : 12, right: isQuote ? 0 : 12, top: body.quoteEvent == null ? 2 : 0, - bottom: hasAttachment && !isContentPreviewing ? 4 : (isHasMerged ? 2 : 0), + bottom: hasAttachment && !isContentPreviewing && !isQuote + ? 4 + : (isHasMerged ? 2 : 0), ); } } diff --git a/lib/widgets/chat/chat_message_input.dart b/lib/widgets/chat/chat_message_input.dart index 7a271a6..4169ac7 100644 --- a/lib/widgets/chat/chat_message_input.dart +++ b/lib/widgets/chat/chat_message_input.dart @@ -208,6 +208,8 @@ class _ChatMessageInputState extends State { final body = EventMessageBody.fromJson(widget.edit!.body); _editTo = widget.edit!; _textController.text = body.text; + _attachments.addAll( + widget.edit!.body['attachments']?.cast() ?? List.empty()); } if (widget.reply != null) { _replyTo = widget.reply!; diff --git a/lib/widgets/posts/post_item.dart b/lib/widgets/posts/post_item.dart index 5e9e357..b56dff9 100644 --- a/lib/widgets/posts/post_item.dart +++ b/lib/widgets/posts/post_item.dart @@ -335,10 +335,10 @@ class _PostItemState extends State { Row( children: [ Icon( - Icons.attachment, - size: 18, + Icons.file_copy, + size: 15, color: _unFocusColor, - ).paddingOnly(right: 6), + ).paddingOnly(right: 5), Text( 'attachmentHint'.trParams( {'count': attachments.length.toString()}, @@ -440,7 +440,7 @@ class _PostItemState extends State { attachmentsId: attachments, isGrid: attachments.length > 1, ), - if (widget.isShowReply && widget.isReactable) + if (widget.isShowReply || widget.isReactable) PostQuickAction( isShowReply: widget.isShowReply, isReactable: widget.isReactable,