fix: set exact reactions length in overlay (#5016)
This commit is contained in:
parent
2e0d38e801
commit
7f09287bc7
3 changed files with 18 additions and 6 deletions
|
|
@ -159,6 +159,13 @@ class MessageSelectionPositionerState extends State<MessageSelectionPositioner>
|
|||
return hasReactions ? 28.0 : 0.0;
|
||||
}
|
||||
|
||||
double get reactionsWidth {
|
||||
if (_reactionsRenderBox != null) {
|
||||
return _reactionsRenderBox!.size.width;
|
||||
}
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
bool get ownMessage =>
|
||||
widget.event.senderId == widget.event.room.client.userID;
|
||||
|
||||
|
|
|
|||
|
|
@ -67,6 +67,7 @@ class OverMessageOverlay extends StatelessWidget {
|
|||
readingAssistanceMode: controller.readingAssistanceMode,
|
||||
overlayKey:
|
||||
'overlay_message_${controller.widget.event.eventId}',
|
||||
reactionsWidth: controller.reactionsWidth,
|
||||
);
|
||||
},
|
||||
),
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ class OverlayCenterContent extends StatelessWidget {
|
|||
final double? messageWidth;
|
||||
|
||||
final bool hasReactions;
|
||||
final double? reactionsWidth;
|
||||
|
||||
final bool isTransitionAnimation;
|
||||
final ReadingAssistanceMode? readingAssistanceMode;
|
||||
|
|
@ -41,6 +42,7 @@ class OverlayCenterContent extends StatelessWidget {
|
|||
required this.nextEvent,
|
||||
required this.prevEvent,
|
||||
required this.hasReactions,
|
||||
this.reactionsWidth,
|
||||
this.onChangeMessageSize,
|
||||
this.sizeAnimation,
|
||||
this.isTransitionAnimation = false,
|
||||
|
|
@ -89,13 +91,15 @@ class OverlayCenterContent extends StatelessWidget {
|
|||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
top: 4.0,
|
||||
left: 4.0,
|
||||
right: ownMessage ? 0 : 12.0,
|
||||
left: ownMessage ? 0.0 : 4.0,
|
||||
),
|
||||
child: PangeaMessageReactions(
|
||||
event,
|
||||
chatController.timeline!,
|
||||
chatController,
|
||||
child: ConstrainedBox(
|
||||
constraints: BoxConstraints(maxWidth: reactionsWidth ?? 0.0),
|
||||
child: PangeaMessageReactions(
|
||||
event,
|
||||
chatController.timeline!,
|
||||
chatController,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue