@@ -18,10 +18,19 @@ struct TransparentView: View {
18
18
19
19
var body : some View {
20
20
ZStack {
21
+ if appState. preferences. desktopInfoBackgroundFrosted {
22
+ BlurEffectView (
23
+ material: . fullScreenUI,
24
+ blendingMode: . behindWindow
25
+ )
26
+ . clipShape ( RoundedRectangle ( cornerRadius: 15 ) )
27
+ . edgesIgnoringSafeArea ( . all)
28
+ }
29
+
21
30
RoundedRectangle ( cornerRadius: 15 )
22
- . fill ( Color . black. opacity ( appState. preferences. desktopInfoBackgroundOpacity) )
23
- . shadow ( radius: 10 ) // Shadow for depth
24
- . clipShape ( RoundedRectangle ( cornerRadius: 15 ) ) // Ensure clipping
31
+ . fill ( Color . black. opacity ( appState. preferences. desktopInfoBackgroundOpacity) )
32
+ . shadow ( radius: 10 ) // Shadow for depth
33
+ . clipShape ( RoundedRectangle ( cornerRadius: 15 ) )
25
34
26
35
VStack ( alignment: . leading) {
27
36
// Title for the Info View
@@ -253,6 +262,25 @@ struct TransparentView: View {
253
262
}
254
263
}
255
264
265
+ struct BlurEffectView : NSViewRepresentable {
266
+ let material : NSVisualEffectView . Material
267
+ let blendingMode : NSVisualEffectView . BlendingMode
268
+
269
+ func makeNSView( context: Context ) -> NSVisualEffectView {
270
+ let view = NSVisualEffectView ( )
271
+ view. material = material // Set material to ultra-thin equivalent
272
+ view. blendingMode = blendingMode // Set blending mode to behindWindow or withinWindow
273
+ view. state = . active // Ensure the effect is active
274
+ return view
275
+ }
276
+
277
+ func updateNSView( _ nsView: NSVisualEffectView , context: Context ) {
278
+ nsView. material = material
279
+ nsView. blendingMode = blendingMode
280
+ nsView. state = . active
281
+ }
282
+ }
283
+
256
284
struct SectionHeaderTransparent : View {
257
285
let title : String
258
286
let addHeader : Bool
0 commit comments