From 1a307285f0cfa988a4d8f5a3a52c21340808f67d Mon Sep 17 00:00:00 2001 From: ggurdin <46800240+ggurdin@users.noreply.github.com> Date: Thu, 18 Sep 2025 09:31:13 -0400 Subject: [PATCH] chore: fix click cursor showing on hover of disabled activity participant widget (#4020) --- .../activity_participant_indicator.dart | 153 +++++++++--------- 1 file changed, 79 insertions(+), 74 deletions(-) diff --git a/lib/pangea/activity_sessions/activity_participant_indicator.dart b/lib/pangea/activity_sessions/activity_participant_indicator.dart index 176dc032f..bc1114351 100644 --- a/lib/pangea/activity_sessions/activity_participant_indicator.dart +++ b/lib/pangea/activity_sessions/activity_participant_indicator.dart @@ -38,84 +38,89 @@ class ActivityParticipantIndicator extends StatelessWidget { @override Widget build(BuildContext context) { final theme = Theme.of(context); - return MouseRegion( - cursor: SystemMouseCursors.click, - child: GestureDetector( - onTap: onTap ?? - (user != null - ? () => showMemberActionsPopupMenu( - context: context, - user: user!, - ) - : null), - child: HoverBuilder( - builder: (context, hovered) { - return Opacity( - opacity: opacity, - child: Container( - padding: padding ?? - const EdgeInsets.symmetric( - vertical: 4.0, - horizontal: 8.0, - ), - decoration: BoxDecoration( - borderRadius: borderRadius ?? BorderRadius.circular(8.0), - color: (hovered || selected) && selectable - ? theme.colorScheme.surfaceContainerHighest - : Colors.transparent, - ), - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - userId != null - ? user?.avatarUrl == null || - user!.avatarUrl!.toString().startsWith("mxc") - ? Avatar( - mxContent: user?.avatarUrl != null - ? user!.avatarUrl! - : null, - name: userId!.localpart, - size: 60.0, - userId: userId, - ) - : ClipRRect( - borderRadius: BorderRadius.circular(30), - child: CachedNetworkImage( - imageUrl: user!.avatarUrl!.toString(), - width: 60.0, - height: 60.0, - fit: BoxFit.cover, - ), - ) - : CircleAvatar( - radius: 30.0, - backgroundColor: theme.colorScheme.primaryContainer, - child: const Icon( - Icons.question_mark, - size: 30.0, + return AbsorbPointer( + absorbing: !selectable, + child: MouseRegion( + cursor: SystemMouseCursors.basic, + child: GestureDetector( + onTap: onTap ?? + (user != null + ? () => showMemberActionsPopupMenu( + context: context, + user: user!, + ) + : null), + child: HoverBuilder( + builder: (context, hovered) { + return Opacity( + opacity: opacity, + child: Container( + padding: padding ?? + const EdgeInsets.symmetric( + vertical: 4.0, + horizontal: 8.0, + ), + decoration: BoxDecoration( + borderRadius: borderRadius ?? BorderRadius.circular(8.0), + color: (hovered || selected) && selectable + ? theme.colorScheme.surfaceContainerHighest + : Colors.transparent, + ), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + userId != null + ? user?.avatarUrl == null || + user!.avatarUrl!.toString().startsWith("mxc") + ? Avatar( + mxContent: user?.avatarUrl != null + ? user!.avatarUrl! + : null, + name: userId!.localpart, + size: 60.0, + userId: userId, + ) + : ClipRRect( + borderRadius: BorderRadius.circular(30), + child: CachedNetworkImage( + imageUrl: user!.avatarUrl!.toString(), + width: 60.0, + height: 60.0, + fit: BoxFit.cover, + ), + ) + : CircleAvatar( + radius: 30.0, + backgroundColor: + theme.colorScheme.primaryContainer, + child: const Icon( + Icons.question_mark, + size: 30.0, + ), ), - ), - Text( - name, - style: const TextStyle( - fontSize: 12.0, + Text( + name, + style: const TextStyle( + fontSize: 12.0, + ), ), - ), - Text( - userId?.localpart ?? L10n.of(context).openRoleLabel, - style: TextStyle( - fontSize: 12.0, - color: (Theme.of(context).brightness == Brightness.light - ? (userId?.localpart?.darkColor ?? name.darkColor) - : (userId?.localpart?.lightColorText ?? - name.lightColorText)), + Text( + userId?.localpart ?? L10n.of(context).openRoleLabel, + style: TextStyle( + fontSize: 12.0, + color: (Theme.of(context).brightness == + Brightness.light + ? (userId?.localpart?.darkColor ?? name.darkColor) + : (userId?.localpart?.lightColorText ?? + name.lightColorText)), + ), ), - ), - ], + ], + ), ), - ), - ); - }, + ); + }, + ), ), ), );