Allow dragging the macOS player controls bar to reposition it

The glass controls capsule can now be dragged anywhere over the video.
Position is stored as a fraction of the container size so it survives
window resizes and aspect-ratio driven sheet resizes, persists across
sessions via SettingsManager, and snaps back magnetically when dropped
near the default bottom-center spot. Travel is clamped so the capsule
stays inside the player and never overlaps the top button row. A
mouseDownCanMoveWindow=false backing view keeps the window's
movable-by-background behavior from swallowing the drag.
This commit is contained in:
Arkadiusz Fal
2026-06-21 17:39:48 +02:00
parent 76ae2717b2
commit 1cd566ae29
4 changed files with 166 additions and 1 deletions

View File

@@ -74,6 +74,8 @@ final class SettingsManager {
#if os(macOS)
var _macPlayerSeparateWindow: Bool?
var _macPlayerFloating: Bool?
var _macControlsBarOffsetX: Double?
var _macControlsBarOffsetY: Double?
var _playerSheetAutoResize: Bool?
#endif
@@ -460,6 +462,8 @@ final class SettingsManager {
#if os(macOS)
_macPlayerSeparateWindow = nil
_macPlayerFloating = nil
_macControlsBarOffsetX = nil
_macControlsBarOffsetY = nil
_playerSheetAutoResize = nil
#endif
// miniPlayerShowVideo and miniPlayerVideoTapAction moved to preset