From 52af9ecbd27195feb6056657668bdbae6d0e272e Mon Sep 17 00:00:00 2001 From: ggurdin <46800240+ggurdin@users.noreply.github.com> Date: Fri, 9 May 2025 12:39:31 -0400 Subject: [PATCH] chore: fix tooltip being squished in room creation state event widget (#2747) --- .../events/room_creation_state_event.dart | 110 +++++++++--------- 1 file changed, 58 insertions(+), 52 deletions(-) diff --git a/lib/pages/chat/events/room_creation_state_event.dart b/lib/pages/chat/events/room_creation_state_event.dart index 4218c3e2a..e53722b8b 100644 --- a/lib/pages/chat/events/room_creation_state_event.dart +++ b/lib/pages/chat/events/room_creation_state_event.dart @@ -61,63 +61,69 @@ class RoomCreationStateEventState extends State { final roomName = event.room.getLocalizedDisplayname(matrixLocals); return Padding( padding: const EdgeInsets.only(bottom: 32.0), - child: Center( - child: ConstrainedBox( - constraints: const BoxConstraints(maxWidth: 256), - child: Material( - color: theme.colorScheme.surfaceContainer, - borderRadius: BorderRadius.circular(AppConfig.borderRadius), - child: Padding( - padding: const EdgeInsets.all(16.0), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Avatar( - mxContent: event.room.avatar, - name: roomName, - size: Avatar.defaultSize * 2, - // #Pangea - userId: event.room.directChatMatrixID, - useRive: true, - // Pangea# - ), - Text( - roomName, - style: theme.textTheme.bodyLarge, - textAlign: TextAlign.center, - ), - const SizedBox(height: 8), - Text( - '${event.originServerTs.localizedTime(context)} | ${l10n.countParticipants((event.room.summary.mJoinedMemberCount ?? 1) + (event.room.summary.mInvitedMemberCount ?? 0))}', - style: theme.textTheme.labelSmall, - textAlign: TextAlign.center, - ), - // #Pangea - InstructionsInlineTooltip( - instructionsEnum: InstructionsEnum.clickMessage, - padding: const EdgeInsets.only( - left: 16.0, - right: 16.0, - top: 16.0, + // #Pangea + // child: Center( + // child: ConstrainedBox( + child: Column( + children: [ + ConstrainedBox( + // Pangea# + constraints: const BoxConstraints(maxWidth: 256), + child: Material( + color: theme.colorScheme.surfaceContainer, + borderRadius: BorderRadius.circular(AppConfig.borderRadius), + child: Padding( + padding: const EdgeInsets.all(16.0), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Avatar( + mxContent: event.room.avatar, + name: roomName, + size: Avatar.defaultSize * 2, + // #Pangea + userId: event.room.directChatMatrixID, + useRive: true, + // Pangea# ), - onClose: () => setState(() {}), - ), - if (_members <= 1 && - InstructionsEnum.clickMessage.isToggledOff) - const InstructionsInlineTooltip( - instructionsEnum: InstructionsEnum.emptyChatWarning, - padding: EdgeInsets.only( - left: 16.0, - right: 16.0, - top: 16.0, - ), + Text( + roomName, + style: theme.textTheme.bodyLarge, + textAlign: TextAlign.center, ), - // Pangea# - ], + const SizedBox(height: 8), + Text( + '${event.originServerTs.localizedTime(context)} | ${l10n.countParticipants((event.room.summary.mJoinedMemberCount ?? 1) + (event.room.summary.mInvitedMemberCount ?? 0))}', + style: theme.textTheme.labelSmall, + textAlign: TextAlign.center, + ), + ], + ), ), ), ), - ), + // #Pangea + const SizedBox(height: 16.0), + InstructionsInlineTooltip( + instructionsEnum: InstructionsEnum.clickMessage, + padding: const EdgeInsets.only( + left: 16.0, + right: 16.0, + top: 16.0, + ), + onClose: () => setState(() {}), + ), + if (_members <= 1 && InstructionsEnum.clickMessage.isToggledOff) + const InstructionsInlineTooltip( + instructionsEnum: InstructionsEnum.emptyChatWarning, + padding: EdgeInsets.only( + left: 16.0, + right: 16.0, + top: 16.0, + ), + ), + // Pangea# + ], ), ); }