mirror of
https://github.com/maxgoedjen/secretive.git
synced 2025-04-18 05:22:11 +00:00
.
This commit is contained in:
parent
9c5eceb4a2
commit
0bbf950216
@ -75,6 +75,7 @@
|
|||||||
ignoresPersistentStateOnLaunch = "NO"
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
debugDocumentVersioning = "YES"
|
debugDocumentVersioning = "YES"
|
||||||
debugServiceExtension = "internal"
|
debugServiceExtension = "internal"
|
||||||
|
enableGPUValidationMode = "1"
|
||||||
allowLocationSimulation = "YES">
|
allowLocationSimulation = "YES">
|
||||||
<BuildableProductRunnable
|
<BuildableProductRunnable
|
||||||
runnableDebuggingMode = "0">
|
runnableDebuggingMode = "0">
|
||||||
|
@ -118,29 +118,33 @@ extension ThumbnailPickerView {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@MainActor class SystemBackground: ObservableObject {
|
||||||
|
|
||||||
|
static let shared = SystemBackground()
|
||||||
|
@Published var image: NSImage?
|
||||||
|
|
||||||
|
private init() {
|
||||||
|
if let mainScreen = NSScreen.main, let imageURL = NSWorkspace.shared.desktopImageURL(for: mainScreen) {
|
||||||
|
image = NSImage(contentsOf: imageURL)
|
||||||
|
} else {
|
||||||
|
image = nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@available(macOS 12.0, *)
|
@available(macOS 12.0, *)
|
||||||
struct SystemBackgroundView: View {
|
struct SystemBackgroundView: View {
|
||||||
|
|
||||||
let anchor: UnitPoint
|
let anchor: UnitPoint
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
if let mainScreen = NSScreen.main, let imageURL = NSWorkspace.shared.desktopImageURL(for: mainScreen) {
|
if let x = SystemBackground.shared.image {
|
||||||
AsyncImage(url: imageURL) { phase in
|
Image(nsImage: x)
|
||||||
switch phase {
|
.resizable()
|
||||||
case .empty, .failure:
|
.scaleEffect(3, anchor: anchor)
|
||||||
Rectangle()
|
.clipped()
|
||||||
.foregroundColor(Color(.systemPurple))
|
.allowsHitTesting(false)
|
||||||
case .success(let image):
|
|
||||||
image
|
|
||||||
.resizable()
|
|
||||||
.scaleEffect(3, anchor: anchor)
|
|
||||||
.clipped()
|
|
||||||
.allowsHitTesting(false)
|
|
||||||
@unknown default:
|
|
||||||
Rectangle()
|
|
||||||
.foregroundColor(Color(.systemPurple))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
Rectangle()
|
Rectangle()
|
||||||
.foregroundColor(Color(.systemPurple))
|
.foregroundColor(Color(.systemPurple))
|
||||||
@ -222,11 +226,11 @@ struct NotificationView: View {
|
|||||||
.foregroundColor(.primary)
|
.foregroundColor(.primary)
|
||||||
}
|
}
|
||||||
}.padding()
|
}.padding()
|
||||||
.redacted(reason: .placeholder)
|
.redacted(reason: .placeholder)
|
||||||
.background(
|
.background(
|
||||||
RoundedRectangle(cornerRadius: 15)
|
RoundedRectangle(cornerRadius: 15)
|
||||||
.foregroundStyle(.ultraThickMaterial)
|
.foregroundStyle(.ultraThickMaterial)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user