From: Roopesh Chander Date: Fri, 11 Jan 2019 11:17:20 +0000 (+0530) Subject: macOS: Fix editor scrolling X-Git-Tag: 0.0.20190207-1~114 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96bd50504bad8becc3d4c12e29c292cbf49ddda2;p=thirdparty%2Fwireguard-apple.git macOS: Fix editor scrolling Signed-off-by: Roopesh Chander --- diff --git a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelEditViewController.swift b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelEditViewController.swift index b818d9f..4edb17a 100644 --- a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelEditViewController.swift +++ b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelEditViewController.swift @@ -28,8 +28,9 @@ class TunnelEditViewController: NSViewController { let minHeight: CGFloat = 310 textView.minSize = NSSize(width: 0, height: minHeight) textView.maxSize = NSSize(width: CGFloat.greatestFiniteMagnitude, height: CGFloat.greatestFiniteMagnitude) - textView.autoresizingMask = [.width, .height] - textView.isHorizontallyResizable = true + textView.autoresizingMask = [.width] // Width should be based on superview width + textView.isHorizontallyResizable = false // Width shouldn't be based on content + textView.isVerticallyResizable = true // Height should be based on content if let textContainer = textView.textContainer { textContainer.size = NSSize(width: minWidth, height: CGFloat.greatestFiniteMagnitude) textContainer.widthTracksTextView = true