Atoll: drop lockscreen music player below widgets in canvas fallback

The Spotify Canvas fallback layout previously centered the panel+artwork
group on screenFrame.midY, so the enlarged artwork tile could push up
into the row of circular widgets (battery, audio, AQI, weather).
Clamp maxCenterY against the bottom edge of both
LockScreenWeatherPanelManager.latestFrame and
LockScreenTimerWidgetPanelManager.latestFrame, with a 20pt clearance,
and guard against the clamp inverting via max(maxCenterY, minCenterY).

The panel reflows through the existing
.atollLockScreenPanelFrameDidChange notification, so the artwork
overlay window follows the new panel position automatically.

Signed-off-by: Jis G Jacob <studiokeys@blissroms.org>
This commit is contained in:
Jis G Jacob 2026-05-12 16:08:25 +05:30
commit d1d9d75ba8

View file

@ -329,8 +329,22 @@ class LockScreenPanelManager {
let baseCenterY = screenFrame.midY
let largestHalfHeight = max(artworkSide, panelSize.height) / 2
let minCenterY = screenFrame.minY + largestHalfHeight + 56
let maxCenterY = screenFrame.maxY - largestHalfHeight - 84
let centerY = min(max(baseCenterY, minCenterY), maxCenterY)
var maxCenterY = screenFrame.maxY - largestHalfHeight - 84
let widgetClearance: CGFloat = 20
if let weatherFrame = LockScreenWeatherPanelManager.shared.latestFrame,
!weatherFrame.isEmpty {
let weatherTopConstrainedCenterY = weatherFrame.minY - widgetClearance - largestHalfHeight
maxCenterY = min(maxCenterY, weatherTopConstrainedCenterY)
}
if let timerFrame = LockScreenTimerWidgetPanelManager.shared.latestFrame,
!timerFrame.isEmpty {
let timerTopConstrainedCenterY = timerFrame.minY - widgetClearance - largestHalfHeight
maxCenterY = min(maxCenterY, timerTopConstrainedCenterY)
}
let resolvedMaxCenterY = max(maxCenterY, minCenterY)
let centerY = min(max(baseCenterY, minCenterY), resolvedMaxCenterY)
return NSRect(
x: groupOriginX + artworkSide + spacing,