aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/macOS/View/KeyValueRow.swift
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2019-01-09 01:31:44 +0530
committerRoopesh Chander <roop@roopc.net>2019-01-14 14:52:35 +0530
commit5a73244ec9781601630209d0c30684daf6e07f67 (patch)
tree97376502328b08d61bf1553213b0a5887a35adea /WireGuard/WireGuard/UI/macOS/View/KeyValueRow.swift
parentmacOS: Manage tunnels: Add empty tunnel pulldown menu implementation (diff)
downloadwireguard-apple-5a73244ec9781601630209d0c30684daf6e07f67.tar.xz
wireguard-apple-5a73244ec9781601630209d0c30684daf6e07f67.zip
macOS: Tunnel detail: Ensure long keys fit
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard/UI/macOS/View/KeyValueRow.swift')
-rw-r--r--WireGuard/WireGuard/UI/macOS/View/KeyValueRow.swift11
1 files changed, 9 insertions, 2 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/View/KeyValueRow.swift b/WireGuard/WireGuard/UI/macOS/View/KeyValueRow.swift
index cdf682cd..9be44255 100644
--- a/WireGuard/WireGuard/UI/macOS/View/KeyValueRow.swift
+++ b/WireGuard/WireGuard/UI/macOS/View/KeyValueRow.swift
@@ -61,9 +61,16 @@ class EditableKeyValueRow: NSView {
keyLabel.firstBaselineAnchor.constraint(equalTo: valueLabel.firstBaselineAnchor),
self.leadingAnchor.constraint(equalTo: keyLabel.leadingAnchor),
keyLabel.trailingAnchor.constraint(equalTo: valueLabel.leadingAnchor, constant: -5),
- valueLabel.trailingAnchor.constraint(equalTo: self.trailingAnchor),
- keyLabel.widthAnchor.constraint(equalToConstant: 120)
+ valueLabel.trailingAnchor.constraint(equalTo: self.trailingAnchor)
])
+
+ keyLabel.setContentCompressionResistancePriority(.defaultHigh + 2, for: .horizontal)
+ keyLabel.setContentHuggingPriority(.defaultHigh, for: .horizontal)
+ valueLabel.setContentHuggingPriority(.defaultLow, for: .horizontal)
+
+ let widthConstraint = keyLabel.widthAnchor.constraint(equalToConstant: 150)
+ widthConstraint.priority = .defaultHigh + 1
+ widthConstraint.isActive = true
}
required init?(coder decoder: NSCoder) {