diff options
author | Roopesh Chander <roop@roopc.net> | 2019-05-09 18:58:12 +0530 |
---|---|---|
committer | Roopesh Chander <roop@roopc.net> | 2019-05-20 16:42:27 +0530 |
commit | 3f25d54dcc60fdb919b8cd7ef10ec502f3eaab7b (patch) | |
tree | f4500ee8c338be0ecf88f251bc0fe89a82db1c12 | |
parent | macOS: Both list and detail main menu items should be always enabled (diff) | |
download | wireguard-apple-3f25d54dcc60fdb919b8cd7ef10ec502f3eaab7b.tar.xz wireguard-apple-3f25d54dcc60fdb919b8cd7ef10ec502f3eaab7b.zip |
macOS: Get back removing tunnel using the Delete key
This now works only when the list view has focus
Signed-off-by: Roopesh Chander <roop@roopc.net>
-rw-r--r-- | WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift index 40a2b9e..982439d 100644 --- a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift +++ b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift @@ -309,6 +309,14 @@ extension TunnelsListTableViewController: NSTableViewDelegate { } } +extension TunnelsListTableViewController { + override func keyDown(with event: NSEvent) { + if event.specialKey == .delete { + handleRemoveTunnelAction() + } + } +} + class FillerButton: NSButton { override var intrinsicContentSize: NSSize { return NSSize(width: NSView.noIntrinsicMetric, height: NSView.noIntrinsicMetric) |