feat(Desktop): Added double tap full-screen support (#178)

Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
PartyDonut 2024-12-12 23:25:07 +01:00 committed by GitHub
parent e0e06e0064
commit 5acce21261
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 58 additions and 53 deletions

View file

@ -69,8 +69,6 @@ class HomeScreen extends ConsumerWidget {
); );
} }
return null; return null;
default:
return null;
} }
}); });
return HeroControllerScope( return HeroControllerScope(

View file

@ -121,8 +121,6 @@ class _DesktopControlsState extends ConsumerState<DesktopControls> {
closePlayer(); closePlayer();
} }
}, },
child: GestureDetector(
onTap: () => toggleOverlay(),
child: MouseRegion( child: MouseRegion(
cursor: showOverlay ? SystemMouseCursors.basic : SystemMouseCursors.none, cursor: showOverlay ? SystemMouseCursors.basic : SystemMouseCursors.none,
onExit: (event) => toggleOverlay(value: false), onExit: (event) => toggleOverlay(value: false),
@ -130,6 +128,16 @@ class _DesktopControlsState extends ConsumerState<DesktopControls> {
onHover: AdaptiveLayout.of(context).isDesktop ? (event) => toggleOverlay(value: true) : null, onHover: AdaptiveLayout.of(context).isDesktop ? (event) => toggleOverlay(value: true) : null,
child: Stack( child: Stack(
children: [ children: [
Positioned.fill(
child: GestureDetector(
onTap: AdaptiveLayout.of(context).inputDevice == InputDevice.pointer
? () => player.playOrPause()
: () => toggleOverlay(),
onDoubleTap: AdaptiveLayout.of(context).inputDevice == InputDevice.pointer
? () => toggleFullScreen(ref)
: null,
),
),
if (subtitleWidget != null) subtitleWidget, if (subtitleWidget != null) subtitleWidget,
if (AdaptiveLayout.of(context).isDesktop) if (AdaptiveLayout.of(context).isDesktop)
Consumer(builder: (context, ref, child) { Consumer(builder: (context, ref, child) {
@ -178,7 +186,6 @@ class _DesktopControlsState extends ConsumerState<DesktopControls> {
), ),
), ),
), ),
),
); );
} }