mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
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:
parent
c8a6c2b1fa
commit
d1d9d75ba8
1 changed files with 16 additions and 2 deletions
|
|
@ -329,8 +329,22 @@ class LockScreenPanelManager {
|
||||||
let baseCenterY = screenFrame.midY
|
let baseCenterY = screenFrame.midY
|
||||||
let largestHalfHeight = max(artworkSide, panelSize.height) / 2
|
let largestHalfHeight = max(artworkSide, panelSize.height) / 2
|
||||||
let minCenterY = screenFrame.minY + largestHalfHeight + 56
|
let minCenterY = screenFrame.minY + largestHalfHeight + 56
|
||||||
let maxCenterY = screenFrame.maxY - largestHalfHeight - 84
|
var maxCenterY = screenFrame.maxY - largestHalfHeight - 84
|
||||||
let centerY = min(max(baseCenterY, minCenterY), maxCenterY)
|
|
||||||
|
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(
|
return NSRect(
|
||||||
x: groupOriginX + artworkSide + spacing,
|
x: groupOriginX + artworkSide + spacing,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue