mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
Working with Pulsating
This commit is contained in:
parent
ce8cce0252
commit
4132b13bdc
2 changed files with 18 additions and 6 deletions
|
|
@ -45,7 +45,7 @@ struct LockScreenLiveActivityOverlay: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
HStack(spacing: 0) {
|
HStack(alignment: .top, spacing: 0) {
|
||||||
Color.clear
|
Color.clear
|
||||||
.background {
|
.background {
|
||||||
HStack {
|
HStack {
|
||||||
|
|
@ -62,13 +62,13 @@ struct LockScreenLiveActivityOverlay: View {
|
||||||
}
|
}
|
||||||
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .leading)
|
||||||
}
|
}
|
||||||
.frame(width: indicatorSize, height: notchSize.height)
|
.frame(width: indicatorSize, height: notchSize.height, alignment: .top)
|
||||||
|
|
||||||
Color.clear
|
Color.clear
|
||||||
.frame(width: notchSize.width, height: notchSize.height)
|
.frame(width: notchSize.width, height: notchSize.height, alignment: .top)
|
||||||
|
|
||||||
Color.clear
|
Color.clear
|
||||||
.frame(width: indicatorSize, height: notchSize.height)
|
.frame(width: indicatorSize, height: notchSize.height, alignment: .top)
|
||||||
}
|
}
|
||||||
.frame(width: baseWidth, height: notchSize.height)
|
.frame(width: baseWidth, height: notchSize.height)
|
||||||
.padding(.horizontal, horizontalPadding)
|
.padding(.horizontal, horizontalPadding)
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,7 @@ class LockScreenLiveActivityWindowManager {
|
||||||
window.level = NSWindow.Level(rawValue: Int(CGShieldingWindowLevel()))
|
window.level = NSWindow.Level(rawValue: Int(CGShieldingWindowLevel()))
|
||||||
window.collectionBehavior = [.canJoinAllSpaces, .stationary, .fullScreenAuxiliary]
|
window.collectionBehavior = [.canJoinAllSpaces, .stationary, .fullScreenAuxiliary]
|
||||||
window.alphaValue = 0
|
window.alphaValue = 0
|
||||||
|
window.animationBehavior = .none
|
||||||
|
|
||||||
self.window = window
|
self.window = window
|
||||||
self.hasDelegated = false
|
self.hasDelegated = false
|
||||||
|
|
@ -82,14 +83,25 @@ class LockScreenLiveActivityWindowManager {
|
||||||
|
|
||||||
let overlay = LockScreenLiveActivityOverlay(state: state, notchSize: notchSize)
|
let overlay = LockScreenLiveActivityOverlay(state: state, notchSize: notchSize)
|
||||||
window.contentView = NSHostingView(rootView: overlay)
|
window.contentView = NSHostingView(rootView: overlay)
|
||||||
|
window.displayIfNeeded()
|
||||||
|
|
||||||
if !hasDelegated {
|
if !hasDelegated {
|
||||||
SkyLightOperator.shared.delegateWindow(window)
|
SkyLightOperator.shared.delegateWindow(window)
|
||||||
hasDelegated = true
|
hasDelegated = true
|
||||||
}
|
}
|
||||||
|
|
||||||
window.alphaValue = 1
|
if !window.isVisible {
|
||||||
|
window.alphaValue = 0
|
||||||
window.orderFrontRegardless()
|
window.orderFrontRegardless()
|
||||||
|
|
||||||
|
NSAnimationContext.runAnimationGroup { context in
|
||||||
|
context.duration = 0.12
|
||||||
|
window.animator().alphaValue = 1
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
window.orderFrontRegardless()
|
||||||
|
window.alphaValue = 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func showLocked() {
|
func showLocked() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue