From d40890c344c4dffd9dd17e2c4e5821d9390c90b6 Mon Sep 17 00:00:00 2001 From: edde746 <86283021+edde746@users.noreply.github.com> Date: Tue, 24 Feb 2026 17:02:12 +0100 Subject: [PATCH] fix: restore long press on seasons and episodes --- lib/screens/media_detail_screen.dart | 11 ++++++++++- lib/screens/season_detail_screen.dart | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/screens/media_detail_screen.dart b/lib/screens/media_detail_screen.dart index 928b7edf..9fd2313c 100644 --- a/lib/screens/media_detail_screen.dart +++ b/lib/screens/media_detail_screen.dart @@ -2464,9 +2464,14 @@ class _SeasonCard extends StatefulWidget { class _SeasonCardState extends State<_SeasonCard> { final _contextMenuKey = GlobalKey(); + Offset? _tapPosition; + + void _storeTapPosition(TapDownDetails details) { + _tapPosition = details.globalPosition; + } void _showContextMenu() { - _contextMenuKey.currentState?.showContextMenu(context); + _contextMenuKey.currentState?.showContextMenu(context, position: _tapPosition); } @override @@ -2491,6 +2496,10 @@ class _SeasonCardState extends State<_SeasonCard> { hint: "Tap to view ${widget.season.title}", child: InkWell( onTap: widget.onTap, + onTapDown: _storeTapPosition, + onLongPress: _showContextMenu, + onSecondaryTapDown: _storeTapPosition, + onSecondaryTap: _showContextMenu, child: Padding( padding: const EdgeInsets.all(12), child: Row( diff --git a/lib/screens/season_detail_screen.dart b/lib/screens/season_detail_screen.dart index 507fabb7..9336b884 100644 --- a/lib/screens/season_detail_screen.dart +++ b/lib/screens/season_detail_screen.dart @@ -343,9 +343,14 @@ class _EpisodeCard extends StatefulWidget { class _EpisodeCardState extends State<_EpisodeCard> { final _contextMenuKey = GlobalKey(); + Offset? _tapPosition; + + void _storeTapPosition(TapDownDetails details) { + _tapPosition = details.globalPosition; + } void _showContextMenu() { - _contextMenuKey.currentState?.showContextMenu(context); + _contextMenuKey.currentState?.showContextMenu(context, position: _tapPosition); } Widget _buildEpisodeMetaRow(BuildContext context) { @@ -405,6 +410,10 @@ class _EpisodeCardState extends State<_EpisodeCard> { child: InkWell( key: Key(widget.episode.ratingKey), onTap: widget.onTap, + onTapDown: _storeTapPosition, + onLongPress: _showContextMenu, + onSecondaryTapDown: _storeTapPosition, + onSecondaryTap: _showContextMenu, hoverColor: Theme.of(context).colorScheme.surface.withValues(alpha: 0.05), child: Container( decoration: BoxDecoration(