Add onSecondaryTap to MeshCard and fix right-click on message text bubbles

This commit is contained in:
Eric Poulsen
2026-06-13 19:22:16 -07:00
parent f1478722b0
commit f34c2a92c3
3 changed files with 15 additions and 18 deletions
+9 -11
View File
@@ -429,16 +429,15 @@ class _ChannelsScreenState extends State<ChannelsScreen>
channelMessageStore, channelMessageStore,
channel, channel,
), ),
child: GestureDetector( onSecondaryTap: PlatformInfo.isDesktop
onSecondaryTapUp: PlatformInfo.isDesktop ? () => _showChannelActions(
? (_) => _showChannelActions( this.context,
this.context, connector,
connector, channelMessageStore,
channelMessageStore, channel,
channel, )
) : null,
: null, child: Row(
child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
// Leading avatar with optional community badge // Leading avatar with optional community badge
@@ -566,7 +565,6 @@ class _ChannelsScreenState extends State<ChannelsScreen>
], ],
), ),
), ),
),
); );
} }
+3 -7
View File
@@ -147,13 +147,6 @@ class _DiscoveryScreenState extends State<DiscoveryScreen> {
connector, connector,
index, index,
); );
if (PlatformInfo.isDesktop) {
return GestureDetector(
onSecondaryTapUp: (_) =>
_showContactContextMenu(contact, connector),
child: tile,
);
}
return tile; return tile;
}, },
), ),
@@ -204,6 +197,9 @@ class _DiscoveryScreenState extends State<DiscoveryScreen> {
} }
}, },
onLongPress: () => _showContactContextMenu(contact, connector), onLongPress: () => _showContactContextMenu(contact, connector),
onSecondaryTap: PlatformInfo.isDesktop
? () => _showContactContextMenu(contact, connector)
: null,
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 10), padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 10),
child: Row( child: Row(
children: [ children: [
+3
View File
@@ -50,6 +50,7 @@ class MeshCard extends StatelessWidget {
final Widget child; final Widget child;
final VoidCallback? onTap; final VoidCallback? onTap;
final VoidCallback? onLongPress; final VoidCallback? onLongPress;
final VoidCallback? onSecondaryTap;
final EdgeInsetsGeometry padding; final EdgeInsetsGeometry padding;
final EdgeInsetsGeometry margin; final EdgeInsetsGeometry margin;
final Color? color; final Color? color;
@@ -61,6 +62,7 @@ class MeshCard extends StatelessWidget {
required this.child, required this.child,
this.onTap, this.onTap,
this.onLongPress, this.onLongPress,
this.onSecondaryTap,
this.padding = const EdgeInsets.all(14), this.padding = const EdgeInsets.all(14),
this.margin = const EdgeInsets.symmetric(horizontal: 16, vertical: 4), this.margin = const EdgeInsets.symmetric(horizontal: 16, vertical: 4),
this.color, this.color,
@@ -89,6 +91,7 @@ class MeshCard extends StatelessWidget {
HapticFeedback.selectionClick(); HapticFeedback.selectionClick();
onLongPress!(); onLongPress!();
}, },
onSecondaryTap: onSecondaryTap,
child: Padding(padding: padding, child: child), child: Padding(padding: padding, child: child),
), ),
), ),