|
|
@@ -36,9 +36,16 @@ private struct WindowSizeAccessor: NSViewRepresentable {
|
|
|
private var didConfigure = false
|
|
|
|
|
|
func configure(window: NSWindow?, width: CGFloat, height: CGFloat) {
|
|
|
- guard !didConfigure, let window else { return }
|
|
|
+ guard let window else { return }
|
|
|
+
|
|
|
+ let contentSize = NSSize(width: width, height: height)
|
|
|
+ let frameSize = window.frameRect(forContentRect: NSRect(origin: .zero, size: contentSize)).size
|
|
|
+ window.minSize = frameSize
|
|
|
+
|
|
|
+ guard !didConfigure else { return }
|
|
|
didConfigure = true
|
|
|
- window.setContentSize(NSSize(width: width, height: height))
|
|
|
+
|
|
|
+ window.setContentSize(contentSize)
|
|
|
window.center()
|
|
|
}
|
|
|
}
|