diff --git a/Sources/Luminare/Utilities/ScreenView.swift b/Sources/Luminare/Utilities/ScreenView.swift index 1167729..f74b675 100644 --- a/Sources/Luminare/Utilities/ScreenView.swift +++ b/Sources/Luminare/Utilities/ScreenView.swift @@ -8,6 +8,7 @@ import SwiftUI public struct ScreenView: View where Content: View { + @Binding var blurred: Bool let screenContent: () -> Content @State private var image: NSImage? @@ -18,7 +19,8 @@ public struct ScreenView: View where Content: View { topTrailingRadius: 12 ) - public init(@ViewBuilder _ screenContent: @escaping () -> Content) { + public init(blurred: Binding = .constant(false), @ViewBuilder _ screenContent: @escaping () -> Content) { + self._blurred = blurred self.screenContent = screenContent } @@ -30,17 +32,11 @@ public struct ScreenView: View where Content: View { .resizable() .aspectRatio(contentMode: .fill) .frame(width: geo.size.width, height: geo.size.height) + .blur(radius: blurred ? 10 : 0) + .opacity(blurred ? 0.5 : 1) } else { - ZStack { - /// We may be able to add the wallpaper - /// But the method changed in Sonoma - /// So this is kinda a v2 thing - Color.black - Image(systemName: "apple.logo") - .font(.system(size: 20)) - .foregroundStyle(.white) - } - .frame(width: geo.size.width, height: geo.size.height) + LuminareSettingsWindow.tint() + .opacity(0.1) } } .allowsHitTesting(false) @@ -52,10 +48,8 @@ public struct ScreenView: View where Content: View { } } .overlay { - if image != nil { - screenContent() - .padding(5) - } + screenContent() + .padding(5) } .clipShape(screenShape)