Improve translucency effect

This commit is contained in:
Arkadiusz Fal
2022-08-06 15:26:59 +02:00
parent 2fd96e3a44
commit 8318b4c5fb
3 changed files with 18 additions and 26 deletions

View File

@@ -7,14 +7,19 @@ struct ControlBackgroundModifier: ViewModifier {
func body(content: Content) -> some View {
if enabled {
content
#if os(macOS)
.background(VisualEffectBlur(material: .hudWindow))
#elseif os(iOS)
.background(VisualEffectBlur(blurStyle: .systemThinMaterial).edgesIgnoringSafeArea(edgesIgnoringSafeArea))
#else
.background(.thinMaterial)
#endif
if #available(iOS 15, macOS 12, *) {
content
.background(.thinMaterial)
} else {
content
#if os(macOS)
.background(VisualEffectBlur(material: .hudWindow))
#elseif os(iOS)
.background(VisualEffectBlur(blurStyle: .systemThinMaterial).edgesIgnoringSafeArea(edgesIgnoringSafeArea))
#else
.background(.thinMaterial)
#endif
}
} else {
content
}