From bfb929b69e50f9f70759f1c8429d50e1723c493d Mon Sep 17 00:00:00 2001 From: ggurdin Date: Tue, 27 Jan 2026 14:07:46 -0500 Subject: [PATCH] chore: Keep cursor as hand when mousing over word-card emojis --- .../lemmas/lemma_highlight_emoji_row.dart | 93 ++++++++++--------- 1 file changed, 51 insertions(+), 42 deletions(-) diff --git a/lib/pangea/lemmas/lemma_highlight_emoji_row.dart b/lib/pangea/lemmas/lemma_highlight_emoji_row.dart index 70d7ed1c2..21396f612 100644 --- a/lib/pangea/lemmas/lemma_highlight_emoji_row.dart +++ b/lib/pangea/lemmas/lemma_highlight_emoji_row.dart @@ -182,52 +182,61 @@ class EmojiChoiceItemState extends State { @override Widget build(BuildContext context) { return HoverBuilder( - builder: (context, hovered) => GestureDetector( - onTap: widget.enabled ? widget.onSelectEmoji : null, - child: Stack( - children: [ - ShimmerBackground( - enabled: shimmer, - shimmerColor: (Theme.of(context).brightness == Brightness.dark) - ? Colors.white - : Theme.of(context).colorScheme.primary, - baseColor: Colors.transparent, - child: CompositedTransformTarget( - link: MatrixState.pAnyState - .layerLinkAndKey(widget.transformTargetId) - .link, - child: AnimatedContainer( - key: MatrixState.pAnyState + builder: (context, hovered) => MouseRegion( + cursor: widget.enabled + ? SystemMouseCursors.click + : SystemMouseCursors.basic, + child: GestureDetector( + onTap: widget.enabled ? widget.onSelectEmoji : null, + child: Stack( + children: [ + ShimmerBackground( + enabled: shimmer, + shimmerColor: (Theme.of(context).brightness == Brightness.dark) + ? Colors.white + : Theme.of(context).colorScheme.primary, + baseColor: Colors.transparent, + child: CompositedTransformTarget( + link: MatrixState.pAnyState .layerLinkAndKey(widget.transformTargetId) - .key, - duration: const Duration(milliseconds: 200), - padding: const EdgeInsets.all(10), - decoration: BoxDecoration( - color: widget.enabled && (hovered || widget.selected) - ? Theme.of(context).colorScheme.secondary.withAlpha(30) - : Colors.transparent, - borderRadius: BorderRadius.circular(AppConfig.borderRadius), - border: widget.selected - ? Border.all( - color: Colors.transparent, - width: 4, - ) - : null, - ), - child: Text( - widget.emoji, - style: Theme.of(context).textTheme.headlineSmall, + .link, + child: AnimatedContainer( + key: MatrixState.pAnyState + .layerLinkAndKey(widget.transformTargetId) + .key, + duration: const Duration(milliseconds: 200), + padding: const EdgeInsets.all(10), + decoration: BoxDecoration( + color: widget.enabled && (hovered || widget.selected) + ? Theme.of(context) + .colorScheme + .secondary + .withAlpha(30) + : Colors.transparent, + borderRadius: + BorderRadius.circular(AppConfig.borderRadius), + border: widget.selected + ? Border.all( + color: Colors.transparent, + width: 4, + ) + : null, + ), + child: Text( + widget.emoji, + style: Theme.of(context).textTheme.headlineSmall, + ), ), ), ), - ), - if (widget.badge != null) - Positioned( - right: 6, - bottom: 6, - child: widget.badge!, - ), - ], + if (widget.badge != null) + Positioned( + right: 6, + bottom: 6, + child: widget.badge!, + ), + ], + ), ), ), );