chore: Make desktop controls more consistent

This commit is contained in:
PartyDonut 2025-10-26 18:20:35 +01:00
parent 39547163c3
commit c9ce5b9b90
2 changed files with 7 additions and 2 deletions

View file

@ -362,7 +362,7 @@ class _DesktopControlsState extends ConsumerState<DesktopControls> {
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
if (AdaptiveLayout.inputDeviceOf(context) == InputDevice.pointer)
if (AdaptiveLayout.isDesktop(context))
Tooltip(
message: context.localized.stop,
child: IconButton(
@ -379,7 +379,7 @@ class _DesktopControlsState extends ConsumerState<DesktopControls> {
),
),
},
if (AdaptiveLayout.inputDeviceOf(context) == InputDevice.pointer &&
if (AdaptiveLayout.isDesktop(context) &&
AdaptiveLayout.viewSizeOf(context) > ViewSize.phone) ...[
VideoVolumeSlider(
onChanged: () => resetTimer(),

View file

@ -93,6 +93,11 @@ class AdaptiveLayout extends InheritedWidget {
return result?.data.controller[tab] ?? ScrollController();
}
static bool isDesktop(BuildContext context) {
final AdaptiveLayout? result = maybeOf(context);
return result?.data.isDesktop ?? false;
}
static EdgeInsets adaptivePadding(BuildContext context, {double horizontalPadding = 16}) {
final viewPadding = MediaQuery.paddingOf(context);
final padding = viewPadding.copyWith(