PathControl // Fix constraint behavior in SwiftUI.

This commit is contained in:
ShikiSuen 2023-09-25 11:16:30 +08:00
parent 00da1266f1
commit 4583bcc562
1 changed files with 3 additions and 0 deletions

View File

@ -231,6 +231,9 @@ public struct PathControl: NSViewRepresentable {
pathCtl.backgroundColor = .controlBackgroundColor
pathCtl.target = context.coordinator
pathCtl.doubleAction = #selector(Coordinator.action)
pathCtl.setContentHuggingPriority(.defaultHigh, for: .vertical)
pathCtl.setContentCompressionResistancePriority(.defaultLow, for: .horizontal)
pathCtl.heightAnchor.constraint(equalToConstant: NSFont.smallSystemFontSize * 2).isActive = true
return pathCtl
}