diff --git a/lib/pangea/widgets/chat/message_selection_overlay.dart b/lib/pangea/widgets/chat/message_selection_overlay.dart index 428d36e79..1d6e5c2a1 100644 --- a/lib/pangea/widgets/chat/message_selection_overlay.dart +++ b/lib/pangea/widgets/chat/message_selection_overlay.dart @@ -373,24 +373,16 @@ class MessageOverlayController extends State // the default spacing between the side of the screen and the message bubble final double messageMargin = pangeaMessageEvent.ownMessage ? Avatar.defaultSize + 16 : 8; - - // the actual spacing between the side of the screen and - // the message bubble, accounts for wide screen - double extraChatSpace = FluffyThemes.isColumnMode(context) - ? ((screenWidth - - (FluffyThemes.columnWidth * 3.5) - - FluffyThemes.navRailWidth) / - 2) + - messageMargin - : messageMargin; - - if (extraChatSpace < messageMargin) { - extraChatSpace = messageMargin; - } + final horizontalPadding = FluffyThemes.isColumnMode(context) ? 8.0 : 0.0; + final chatViewWidth = screenWidth - + (FluffyThemes.isColumnMode(context) + ? (FluffyThemes.columnWidth + FluffyThemes.navRailWidth) + : 0); + final maxWidth = chatViewWidth - (2 * horizontalPadding) - messageMargin; final overlayMessage = Container( - constraints: const BoxConstraints( - maxWidth: FluffyThemes.columnWidth * 2.5, + constraints: BoxConstraints( + maxWidth: maxWidth, ), child: Material( type: MaterialType.transparency, @@ -439,21 +431,20 @@ class MessageOverlayController extends State ), ); - final horizontalPadding = FluffyThemes.isColumnMode(context) ? 8.0 : 0.0; final columnOffset = FluffyThemes.isColumnMode(context) ? FluffyThemes.columnWidth + FluffyThemes.navRailWidth : 0; - final double leftPadding = widget._pangeaMessageEvent.ownMessage - ? extraChatSpace + final double? leftPadding = widget._pangeaMessageEvent.ownMessage + ? null : messageOffset!.dx - horizontalPadding - columnOffset; - final double rightPadding = widget._pangeaMessageEvent.ownMessage + final double? rightPadding = widget._pangeaMessageEvent.ownMessage ? screenWidth - messageOffset!.dx - messageSize!.width - horizontalPadding - : extraChatSpace; + : null; final positionedOverlayMessage = _overlayPositionAnimation == null ? Positioned( diff --git a/lib/pangea/widgets/chat/message_toolbar.dart b/lib/pangea/widgets/chat/message_toolbar.dart index 704338764..b420ddcaa 100644 --- a/lib/pangea/widgets/chat/message_toolbar.dart +++ b/lib/pangea/widgets/chat/message_toolbar.dart @@ -120,34 +120,40 @@ class MessageToolbarState extends State { .layerLinkAndKey('${widget.pangeaMessageEvent.eventId}-toolbar') .key, type: MaterialType.transparency, - child: Column( + child: Row( + mainAxisSize: MainAxisSize.min, children: [ - Container( - decoration: BoxDecoration( - color: Theme.of(context).cardColor, - border: Border.all( - width: 2, - color: Theme.of(context).colorScheme.primary.withOpacity(0.5), - ), - borderRadius: const BorderRadius.all( - Radius.circular(AppConfig.borderRadius), - ), - ), - constraints: const BoxConstraints( - maxHeight: AppConfig.toolbarMaxHeight, - ), - child: Row( - children: [ - Expanded( - child: SingleChildScrollView( - child: AnimatedSize( - duration: FluffyThemes.animationDuration, - child: toolbarContent, - ), + Column( + children: [ + Container( + decoration: BoxDecoration( + color: Theme.of(context).cardColor, + border: Border.all( + width: 2, + color: + Theme.of(context).colorScheme.primary.withOpacity(0.5), + ), + borderRadius: const BorderRadius.all( + Radius.circular(AppConfig.borderRadius), ), ), - ], - ), + constraints: const BoxConstraints( + maxHeight: AppConfig.toolbarMaxHeight, + ), + // child: Row( + // children: [ + // Expanded( + child: SingleChildScrollView( + child: AnimatedSize( + duration: FluffyThemes.animationDuration, + child: toolbarContent, + ), + ), + // ), + // ], + // ), + ), + ], ), ], ), diff --git a/lib/pangea/widgets/igc/paywall_card.dart b/lib/pangea/widgets/igc/paywall_card.dart index a2c35ff86..20b5fcefe 100644 --- a/lib/pangea/widgets/igc/paywall_card.dart +++ b/lib/pangea/widgets/igc/paywall_card.dart @@ -1,4 +1,5 @@ import 'package:fluffychat/config/app_config.dart'; +import 'package:fluffychat/pages/chat/chat.dart'; import 'package:fluffychat/pangea/utils/bot_style.dart'; import 'package:fluffychat/pangea/widgets/common/bot_face_svg.dart'; import 'package:fluffychat/pangea/widgets/igc/card_header.dart'; @@ -7,8 +8,10 @@ import 'package:flutter/material.dart'; import 'package:flutter_gen/gen_l10n/l10n.dart'; class PaywallCard extends StatelessWidget { + final ChatController chatController; const PaywallCard({ super.key, + required this.chatController, }); @override @@ -69,6 +72,7 @@ class PaywallCard extends StatelessWidget { width: double.infinity, child: TextButton( onPressed: () { + chatController.clearSelectedEvents(); MatrixState.pangeaController.subscriptionController .showPaywall(context); },