]> git.ipfire.org Git - thirdparty/wireguard-apple.git/commitdiff
macOS: Fix autolayout errors on Add Empty Tunnel
authorRoopesh Chander <roop@roopc.net>
Thu, 17 Jan 2019 08:50:09 +0000 (14:20 +0530)
committerRoopesh Chander <roop@roopc.net>
Thu, 17 Jan 2019 08:50:09 +0000 (14:20 +0530)
Signed-off-by: Roopesh Chander <roop@roopc.net>
WireGuard/WireGuard/UI/macOS/ViewController/TunnelEditViewController.swift

index 1ca6dc3abdc85c04db53211200f25e49d3101ed4..7d0d2024bf9e0546c92df9bb4a4dd6d9a2e7c850 100644 (file)
@@ -25,7 +25,7 @@ class TunnelEditViewController: NSViewController {
     let textView: ConfTextView = {
         let textView = ConfTextView()
         let minWidth: CGFloat = 120
-        let minHeight: CGFloat = 60
+        let minHeight: CGFloat = 0
         textView.minSize = NSSize(width: 0, height: minHeight)
         textView.maxSize = NSSize(width: CGFloat.greatestFiniteMagnitude, height: CGFloat.greatestFiniteMagnitude)
         textView.autoresizingMask = [.width] // Width should be based on superview width
@@ -124,10 +124,7 @@ class TunnelEditViewController: NSViewController {
             // Creating a new tunnel
             let privateKey = Curve25519.generatePrivateKey()
             let publicKey = Curve25519.generatePublicKey(fromPrivateKey: privateKey)
-            let bootstrappingText = """
-            [Interface]
-            PrivateKey = \(privateKey.base64EncodedString())
-            """
+            let bootstrappingText = "[Interface]\nPrivateKey = \(privateKey.base64EncodedString())\n"
             publicKeyRow.value = publicKey.base64EncodedString()
             textView.string = bootstrappingText
             selectedActivateOnDemandOption = .none