aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2019-01-02 18:57:09 +0530
committerRoopesh Chander <roop@roopc.net>2019-01-14 14:52:31 +0530
commitc946c0ea4806f5355e98418d95fe3cdd3ce1baf8 (patch)
tree738a84d2030906a94dcec70a7c21be4076f6204c /WireGuard
parentmacOS: Manage tunnels: Fix list view look (diff)
downloadwireguard-apple-c946c0ea4806f5355e98418d95fe3cdd3ce1baf8.tar.xz
wireguard-apple-c946c0ea4806f5355e98418d95fe3cdd3ce1baf8.zip
macOS: Manage tunnels: Add a filler button
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to '')
-rw-r--r--WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift30
1 files changed, 29 insertions, 1 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift
index 7a4cdfa9..05aabbef 100644
--- a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift
+++ b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift
@@ -65,11 +65,15 @@ class TunnelsListTableViewController: NSViewController {
clipView.documentView = tableView
scrollView.contentView = clipView
+ let fillerButton = FillerButton()
+
let containerView = NSView()
containerView.addSubview(scrollView)
containerView.addSubview(buttonBar)
+ containerView.addSubview(fillerButton)
scrollView.translatesAutoresizingMaskIntoConstraints = false
buttonBar.translatesAutoresizingMaskIntoConstraints = false
+ fillerButton.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
containerView.topAnchor.constraint(equalTo: scrollView.topAnchor),
@@ -77,7 +81,11 @@ class TunnelsListTableViewController: NSViewController {
containerView.trailingAnchor.constraint(equalTo: scrollView.trailingAnchor),
scrollView.bottomAnchor.constraint(equalTo: buttonBar.topAnchor, constant: 1),
containerView.leadingAnchor.constraint(equalTo: buttonBar.leadingAnchor),
- containerView.bottomAnchor.constraint(equalTo: buttonBar.bottomAnchor)
+ containerView.bottomAnchor.constraint(equalTo: buttonBar.bottomAnchor),
+ scrollView.bottomAnchor.constraint(equalTo: fillerButton.topAnchor, constant: 1),
+ containerView.bottomAnchor.constraint(equalTo: fillerButton.bottomAnchor),
+ buttonBar.trailingAnchor.constraint(equalTo: fillerButton.leadingAnchor, constant: 1),
+ fillerButton.trailingAnchor.constraint(equalTo: containerView.trailingAnchor)
])
NSLayoutConstraint.activate([
@@ -141,3 +149,23 @@ extension TunnelsListTableViewController: NSTableViewDelegate {
return cell
}
}
+
+class FillerButton: NSButton {
+ override var intrinsicContentSize: NSSize {
+ return NSSize(width: NSView.noIntrinsicMetric, height: NSView.noIntrinsicMetric)
+ }
+
+ init() {
+ super.init(frame: CGRect.zero)
+ title = ""
+ bezelStyle = .smallSquare
+ }
+
+ required init?(coder: NSCoder) {
+ fatalError("init(coder:) has not been implemented")
+ }
+
+ override func mouseDown(with event: NSEvent) {
+ // Eat mouseDown event, so that the button looks enabled but is unresponsive
+ }
+}