mirror of
https://github.com/yattee/yattee.git
synced 2024-12-24 06:23:42 +00:00
ba1115fe2a
WIP on controls Chapters working Add previews variable Add lists ids WIP
23 lines
606 B
Swift
23 lines
606 B
Swift
import Foundation
|
|
import SwiftUI
|
|
|
|
struct ControlBackgroundModifier: ViewModifier {
|
|
var enabled = true
|
|
var edgesIgnoringSafeArea = Edge.Set()
|
|
|
|
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
|
|
} else {
|
|
content
|
|
}
|
|
}
|
|
}
|