mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt trackpad pan
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -833,17 +833,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
if (cumulativeDelta.distance < 1) return;
|
if (cumulativeDelta.distance < 1) return;
|
||||||
if (cumulativeDelta.dx.abs() > 3 * cumulativeDelta.dy.abs()) {
|
if (cumulativeDelta.dx.abs() > 3 * cumulativeDelta.dy.abs()) {
|
||||||
_gestureType = GestureType.horizontal;
|
_gestureType = GestureType.horizontal;
|
||||||
if (Utils.isMobile) {
|
_showControlsIfNeeded();
|
||||||
late final isFullScreen = this.isFullScreen;
|
|
||||||
final progressType = plPlayerController.progressType;
|
|
||||||
if (progressType == BtmProgressBehavior.alwaysHide ||
|
|
||||||
(isFullScreen &&
|
|
||||||
progressType == BtmProgressBehavior.onlyHideFullScreen) ||
|
|
||||||
(!isFullScreen &&
|
|
||||||
progressType == BtmProgressBehavior.onlyShowFullScreen)) {
|
|
||||||
plPlayerController.controls = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (cumulativeDelta.dy.abs() > 3 * cumulativeDelta.dx.abs()) {
|
} else if (cumulativeDelta.dy.abs() > 3 * cumulativeDelta.dx.abs()) {
|
||||||
if (!plPlayerController.enableSlideVolumeBrightness &&
|
if (!plPlayerController.enableSlideVolumeBrightness &&
|
||||||
!plPlayerController.enableSlideFS) {
|
!plPlayerController.enableSlideFS) {
|
||||||
@@ -1090,12 +1080,27 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _showControlsIfNeeded() {
|
||||||
|
if (plPlayerController.isLive) return;
|
||||||
|
late final isFullScreen = this.isFullScreen;
|
||||||
|
final progressType = plPlayerController.progressType;
|
||||||
|
if (progressType == BtmProgressBehavior.alwaysHide ||
|
||||||
|
(isFullScreen &&
|
||||||
|
progressType == BtmProgressBehavior.onlyHideFullScreen) ||
|
||||||
|
(!isFullScreen &&
|
||||||
|
progressType == BtmProgressBehavior.onlyShowFullScreen)) {
|
||||||
|
plPlayerController.controls = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void onPointerPanZoomUpdate(PointerPanZoomUpdateEvent event) {
|
void onPointerPanZoomUpdate(PointerPanZoomUpdateEvent event) {
|
||||||
|
if (plPlayerController.controlsLock.value) return;
|
||||||
if (_gestureType == null) {
|
if (_gestureType == null) {
|
||||||
final pan = event.pan;
|
final pan = event.pan;
|
||||||
if (pan.distance < 1) return;
|
if (pan.distance < 1) return;
|
||||||
if (pan.dx.abs() > 3 * pan.dy.abs()) {
|
if (pan.dx.abs() > 3 * pan.dy.abs()) {
|
||||||
_gestureType = GestureType.horizontal;
|
_gestureType = GestureType.horizontal;
|
||||||
|
_showControlsIfNeeded();
|
||||||
} else if (pan.dy.abs() > 3 * pan.dx.abs()) {
|
} else if (pan.dy.abs() > 3 * pan.dx.abs()) {
|
||||||
_gestureType = GestureType.right;
|
_gestureType = GestureType.right;
|
||||||
}
|
}
|
||||||
@@ -2100,7 +2105,7 @@ Widget buildSeekPreviewWidget(
|
|||||||
|
|
||||||
final double scale =
|
final double scale =
|
||||||
plPlayerController.isFullScreen.value &&
|
plPlayerController.isFullScreen.value &&
|
||||||
!plPlayerController.isVertical
|
(Utils.isDesktop || !plPlayerController.isVertical)
|
||||||
? 4
|
? 4
|
||||||
: 3;
|
: 3;
|
||||||
double height = 27 * scale;
|
double height = 27 * scale;
|
||||||
|
|||||||
Reference in New Issue
Block a user