#315 viewer: use 1/8 for screen edge width ratio in landscape

This commit is contained in:
Thibault Deckers 2022-09-03 15:45:09 +02:00
parent 0739222e66
commit bae85ae80b

View file

@ -226,10 +226,10 @@ class _EntryPageViewState extends State<EntryPageView> {
? (alignment) {
final x = alignment.x;
if (seekGesture) {
if (x < .25) {
if (x < sideRatio) {
_applyAction(EntryAction.videoReplay10);
return true;
} else if (x > .75) {
} else if (x > 1 - sideRatio) {
_applyAction(EntryAction.videoSkip10);
return true;
}
@ -394,10 +394,10 @@ class _EntryPageViewState extends State<EntryPageView> {
void _onTap({Alignment? alignment}) {
if (settings.viewerGestureSideTapNext && alignment != null) {
final x = alignment.x;
if (x < .25) {
if (x < sideRatio) {
JumpToPreviousEntryNotification().dispatch(context);
return;
} else if (x > .75) {
} else if (x > 1 - sideRatio) {
JumpToNextEntryNotification().dispatch(context);
return;
}
@ -419,6 +419,15 @@ class _EntryPageViewState extends State<EntryPageView> {
);
}
double get sideRatio {
switch (context.read<MediaQueryData>().orientation) {
case Orientation.portrait:
return 1 / 4;
case Orientation.landscape:
return 1 / 8;
}
}
static ScaleState _vectorScaleStateCycle(ScaleState actual) {
switch (actual) {
case ScaleState.initial: