mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-08 23:18:16 -07:00
chore: Make desktop controls more consistent
This commit is contained in:
parent
39547163c3
commit
c9ce5b9b90
2 changed files with 7 additions and 2 deletions
|
|
@ -362,7 +362,7 @@ class _DesktopControlsState extends ConsumerState<DesktopControls> {
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
if (AdaptiveLayout.inputDeviceOf(context) == InputDevice.pointer)
|
if (AdaptiveLayout.isDesktop(context))
|
||||||
Tooltip(
|
Tooltip(
|
||||||
message: context.localized.stop,
|
message: context.localized.stop,
|
||||||
child: IconButton(
|
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) ...[
|
AdaptiveLayout.viewSizeOf(context) > ViewSize.phone) ...[
|
||||||
VideoVolumeSlider(
|
VideoVolumeSlider(
|
||||||
onChanged: () => resetTimer(),
|
onChanged: () => resetTimer(),
|
||||||
|
|
|
||||||
|
|
@ -93,6 +93,11 @@ class AdaptiveLayout extends InheritedWidget {
|
||||||
return result?.data.controller[tab] ?? ScrollController();
|
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}) {
|
static EdgeInsets adaptivePadding(BuildContext context, {double horizontalPadding = 16}) {
|
||||||
final viewPadding = MediaQuery.paddingOf(context);
|
final viewPadding = MediaQuery.paddingOf(context);
|
||||||
final padding = viewPadding.copyWith(
|
final padding = viewPadding.copyWith(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue