🐛 Bug fixes

This commit is contained in:
LittleSheep 2024-08-06 20:00:13 +08:00
parent 1d36b30361
commit 73982f48d6
5 changed files with 19 additions and 9 deletions

View File

@ -50,10 +50,10 @@ class ChatEvent extends StatelessWidget {
return Row( return Row(
children: [ children: [
Icon( Icon(
Icons.attachment, Icons.file_copy,
size: 18, size: 15,
color: unFocusColor, color: unFocusColor,
).paddingOnly(right: 6), ).paddingOnly(right: 5),
Text( Text(
'attachmentHint'.trParams( 'attachmentHint'.trParams(
{'count': attachments.length.toString()}, {'count': attachments.length.toString()},
@ -221,6 +221,8 @@ class ChatEvent extends StatelessWidget {
], ],
), ),
_buildContent().paddingOnly(left: 0.5), _buildContent().paddingOnly(left: 0.5),
_buildAttachment(context, isMinimal: true)
.paddingOnly(left: 0),
], ],
), ),
), ),

View File

@ -31,7 +31,11 @@ class ChatEventMessageActionLog extends StatelessWidget {
).paddingOnly( ).paddingOnly(
left: isQuote ? 0 : (isMerged ? 64 : 12), left: isQuote ? 0 : (isMerged ? 64 : 12),
top: 2, top: 2,
bottom: isHasMerged ? 2 : 0, bottom: isQuote
? 0
: isHasMerged
? 2
: 0,
), ),
); );
} }

View File

@ -67,7 +67,9 @@ class ChatEventMessage extends StatelessWidget {
left: isQuote ? 0 : 12, left: isQuote ? 0 : 12,
right: isQuote ? 0 : 12, right: isQuote ? 0 : 12,
top: body.quoteEvent == null ? 2 : 0, top: body.quoteEvent == null ? 2 : 0,
bottom: hasAttachment && !isContentPreviewing ? 4 : (isHasMerged ? 2 : 0), bottom: hasAttachment && !isContentPreviewing && !isQuote
? 4
: (isHasMerged ? 2 : 0),
); );
} }
} }

View File

@ -208,6 +208,8 @@ class _ChatMessageInputState extends State<ChatMessageInput> {
final body = EventMessageBody.fromJson(widget.edit!.body); final body = EventMessageBody.fromJson(widget.edit!.body);
_editTo = widget.edit!; _editTo = widget.edit!;
_textController.text = body.text; _textController.text = body.text;
_attachments.addAll(
widget.edit!.body['attachments']?.cast<int>() ?? List.empty());
} }
if (widget.reply != null) { if (widget.reply != null) {
_replyTo = widget.reply!; _replyTo = widget.reply!;

View File

@ -335,10 +335,10 @@ class _PostItemState extends State<PostItem> {
Row( Row(
children: [ children: [
Icon( Icon(
Icons.attachment, Icons.file_copy,
size: 18, size: 15,
color: _unFocusColor, color: _unFocusColor,
).paddingOnly(right: 6), ).paddingOnly(right: 5),
Text( Text(
'attachmentHint'.trParams( 'attachmentHint'.trParams(
{'count': attachments.length.toString()}, {'count': attachments.length.toString()},
@ -440,7 +440,7 @@ class _PostItemState extends State<PostItem> {
attachmentsId: attachments, attachmentsId: attachments,
isGrid: attachments.length > 1, isGrid: attachments.length > 1,
), ),
if (widget.isShowReply && widget.isReactable) if (widget.isShowReply || widget.isReactable)
PostQuickAction( PostQuickAction(
isShowReply: widget.isShowReply, isShowReply: widget.isShowReply,
isReactable: widget.isReactable, isReactable: widget.isReactable,