mirror of
https://github.com/yattee/yattee.git
synced 2026-10-28 15:37:17 +00:00
Block player dismiss pan from the panel resize grabber strip
Starting a column resize drag with a diagonal (downward) motion let the window-level dismiss pan begin, cancelling the resize and dragging the player down instead. The grabber now publishes its strip frame (with 8pt slop on each side) to NavigationCoordinator, and the dismiss pan refuses to begin from touches inside it — same exclusion pattern as the corner layout's below-video panel frame.
This commit is contained in:
@@ -146,6 +146,8 @@ private final class DragToDismissGestureHandler: NSObject, UIGestureRecognizerDe
|
||||
var getPortraitPanelFrame: (() -> CGRect)?
|
||||
/// Returns the corner layout below-video panel frame in screen coordinates (blocks dismiss pan)
|
||||
var getCornerBelowPanelFrame: (() -> CGRect)?
|
||||
/// Returns the panel resize grabber strip frame in screen coordinates (blocks dismiss pan)
|
||||
var getPanelResizeGrabberFrame: (() -> CGRect)?
|
||||
/// Returns whether the portrait panel is currently visible (not hidden off-screen)
|
||||
var isPortraitPanelVisible: (() -> Bool)?
|
||||
/// Returns the progress bar frame in screen coordinates (for gesture conflict resolution)
|
||||
@@ -378,6 +380,16 @@ private final class DragToDismissGestureHandler: NSObject, UIGestureRecognizerDe
|
||||
}
|
||||
}
|
||||
|
||||
// Don't begin dismiss gesture from the panel resize grabber strip —
|
||||
// a diagonal resize drag would otherwise be cancelled mid-resize
|
||||
let grabberFrame = getPanelResizeGrabberFrame?() ?? .zero
|
||||
if !grabberFrame.isEmpty {
|
||||
let touchLocation = panGesture.location(in: nil)
|
||||
if grabberFrame.contains(touchLocation) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// When portrait panel is visible, only allow dismiss from player area (above panel)
|
||||
// This prevents race conditions where isPanelDragging isn't set yet when gesture begins
|
||||
let panelFrame = getPortraitPanelFrame?() ?? .zero
|
||||
@@ -860,6 +872,9 @@ final class ExpandedPlayerWindowManager {
|
||||
handler.getCornerBelowPanelFrame = { [weak self] in
|
||||
self?.appEnvironment?.navigationCoordinator.cornerBelowPanelFrame ?? .zero
|
||||
}
|
||||
handler.getPanelResizeGrabberFrame = { [weak self] in
|
||||
self?.appEnvironment?.navigationCoordinator.panelResizeGrabberFrame ?? .zero
|
||||
}
|
||||
handler.isPortraitPanelVisible = { [weak self] in
|
||||
self?.appEnvironment?.navigationCoordinator.isPortraitPanelVisible ?? true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user