mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-11 02:51:11 +00:00
Add liquid glass for toast view
This commit is contained in:
1 parent
e1924e1919
commit
3ed93e6079
1 file changed
+17
-1
@@ -218,7 +218,7 @@ struct QuickDropToastView: View {
|
||||
startAutoHideIfPossible()
|
||||
}
|
||||
.background(
|
||||
VisualEffectView(material: .hudWindow, cornerRadius: toastCornerRadius)
|
||||
AdaptiveToastBackgroundLayer(cornerRadius: toastCornerRadius)
|
||||
)
|
||||
.overlay(
|
||||
RoundedRectangle(cornerRadius: toastCornerRadius, style: .continuous)
|
||||
@@ -387,6 +387,22 @@ fileprivate struct ActionDividerLine: View {
|
||||
}
|
||||
|
||||
|
||||
struct AdaptiveToastBackgroundLayer: View {
|
||||
let cornerRadius: CGFloat
|
||||
|
||||
var body: some View {
|
||||
Group {
|
||||
if #available(macOS 26.0, *) {
|
||||
Color.clear
|
||||
.glassEffect(.regular, in: .rect(cornerRadius: cornerRadius, style: .continuous))
|
||||
} else {
|
||||
VisualEffectView(material: .hudWindow, cornerRadius: cornerRadius)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// NSVisualEffectView wrapper for macOS 11 compatible blur/vibrancy
|
||||
struct VisualEffectView: NSViewRepresentable {
|
||||
var material: NSVisualEffectView.Material = .hudWindow
|
||||
|
||||
Reference in new issue
Block a user