mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 23:24:32 +00:00
Update LiquidGlassBackground to remove polling
This commit is contained in:
parent
4ec5c84b9c
commit
1d6cdf866a
8 changed files with 145 additions and 59 deletions
|
|
@ -4520,7 +4520,6 @@ private struct LockScreenGlassVariantPreviewCell: View {
|
|||
private let cornerRadius: CGFloat = 16
|
||||
private let previewCornerRadius: CGFloat = 14
|
||||
private let previewSize = CGSize(width: 190, height: 96)
|
||||
@State private var previewToken: Double = 0
|
||||
|
||||
var body: some View {
|
||||
ZStack {
|
||||
|
|
@ -4549,7 +4548,6 @@ private struct LockScreenGlassVariantPreviewCell: View {
|
|||
Logger.log("Lock screen glass preview disappeared", category: .performance)
|
||||
}
|
||||
.onChange(of: variant) { _, newValue in
|
||||
previewToken = Date().timeIntervalSinceReferenceDate
|
||||
Logger.log("Lock screen glass preview variant changed to v\(newValue.rawValue)", category: .performance)
|
||||
}
|
||||
}
|
||||
|
|
@ -4557,9 +4555,7 @@ private struct LockScreenGlassVariantPreviewCell: View {
|
|||
private var liquidGlassPreview: some View {
|
||||
LiquidGlassBackground(
|
||||
variant: variant,
|
||||
cornerRadius: previewCornerRadius,
|
||||
trigger: previewToken,
|
||||
jitterEnabled: false
|
||||
cornerRadius: previewCornerRadius
|
||||
) {
|
||||
Color.white.opacity(0.04)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,9 +59,10 @@ class SettingsWindowController: NSWindowController {
|
|||
window.titleVisibility = .visible
|
||||
window.toolbarStyle = .unified
|
||||
window.isMovableByWindowBackground = true
|
||||
window.level = .normal
|
||||
|
||||
// Make it behave like a regular app window with proper Spaces support
|
||||
window.collectionBehavior = [.managed, .participatesInCycle, .fullScreenAuxiliary]
|
||||
window.collectionBehavior = [.managed, .participatesInCycle]
|
||||
|
||||
// Ensure proper window behavior
|
||||
window.hidesOnDeactivate = false
|
||||
|
|
@ -85,6 +86,10 @@ class SettingsWindowController: NSWindowController {
|
|||
func showWindow() {
|
||||
// Ensure window exists
|
||||
_ = window
|
||||
|
||||
// Reassert regular window semantics in case any prior state mutated this window.
|
||||
window?.level = .normal
|
||||
window?.collectionBehavior = [.managed, .participatesInCycle]
|
||||
|
||||
// If window is already visible, bring it to front properly
|
||||
if window?.isVisible == true {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue