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

@@ -47,6 +47,8 @@ enum SettingsKey: String, CaseIterable {
// Platform-specific
case macPlayerSeparateWindow
case macPlayerFloating
case macControlsBarOffsetX // Normalized X offset of macOS control bar from default position
case macControlsBarOffsetY // Normalized Y offset of macOS control bar from default position
case playerSheetAutoResize
case listStyle
@@ -140,6 +142,7 @@ enum SettingsKey: String, CaseIterable {
switch self {
case .preferredQuality, .cellularQuality, .allowSoftwareDecodedFormats,
.macPlayerSeparateWindow, .macPlayerFloating, .listStyle,
.macControlsBarOffsetX, .macControlsBarOffsetY,
// Home layout different UI paradigms per platform
.homeShortcutOrder, .homeShortcutVisibility, .homeShortcutLayout, .homeShortcutCardStyle,
.homeShortcutCardColor, .homeShortcutColorfulPalette, .homeShortcutCustomPaletteColors,