Skip to content

Commit

Permalink
🐛 Convenience init for LuminareView
Browse files Browse the repository at this point in the history
  • Loading branch information
KrLite committed Dec 17, 2024
1 parent 6dfdb24 commit f4685fa
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Sources/Luminare/Main Window/LuminareWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public class LuminareWindow: NSWindow {
/// - content: the content view of the window, wrapped in a ``LuminareView``.
public init(
blurRadius: CGFloat? = nil,
minFrame _: CGSize = .init(width: 100, height: 100),
maxFrame _: CGSize = .init(width: CGFloat.infinity, height: CGFloat.infinity),
content: @escaping () -> some View
) {
self.initializationTime = .now
Expand Down Expand Up @@ -49,6 +51,20 @@ public class LuminareWindow: NSWindow {
alphaValue = 0
}

public convenience init(
blurRadius: CGFloat? = nil,
minWidth: CGFloat = 100, minHeight: CGFloat = 100,
maxWidth: CGFloat = .infinity, maxHeight: CGFloat = .infinity,
content: @escaping () -> some View
) {
self.init(
blurRadius: blurRadius,
minFrame: .init(width: minWidth, height: minHeight),
maxFrame: .init(width: maxWidth, height: maxHeight),
content: content
)
}

/// Shows this window.
/// This action activates the current application and orders the window to the frontmost.
public func show() {
Expand Down

0 comments on commit f4685fa

Please sign in to comment.