Skip to content

Commit

Permalink
✨ Replace ScreenView startup screen with accent color
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKai77 committed Sep 14, 2024
1 parent 4de2df1 commit 6115039
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions Sources/Luminare/Utilities/ScreenView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import SwiftUI

public struct ScreenView<Content>: View where Content: View {
@Binding var blurred: Bool
let screenContent: () -> Content
@State private var image: NSImage?

Expand All @@ -18,7 +19,8 @@ public struct ScreenView<Content>: View where Content: View {
topTrailingRadius: 12
)

public init(@ViewBuilder _ screenContent: @escaping () -> Content) {
public init(blurred: Binding<Bool> = .constant(false), @ViewBuilder _ screenContent: @escaping () -> Content) {
self._blurred = blurred
self.screenContent = screenContent
}

Expand All @@ -30,17 +32,11 @@ public struct ScreenView<Content>: View where Content: View {
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: geo.size.width, height: geo.size.height)
.blur(radius: blurred ? 10 : 0)
.opacity(blurred ? 0.5 : 1)
} else {
ZStack {
/// We may be able to add the wallpaper
/// But the method changed in Sonoma
/// So this is kinda a v2 thing
Color.black
Image(systemName: "apple.logo")
.font(.system(size: 20))
.foregroundStyle(.white)
}
.frame(width: geo.size.width, height: geo.size.height)
LuminareSettingsWindow.tint()
.opacity(0.1)
}
}
.allowsHitTesting(false)
Expand All @@ -52,10 +48,8 @@ public struct ScreenView<Content>: View where Content: View {
}
}
.overlay {
if image != nil {
screenContent()
.padding(5)
}
screenContent()
.padding(5)
}
.clipShape(screenShape)

Expand Down

0 comments on commit 6115039

Please sign in to comment.