aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/macOS
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2019-02-22 18:18:51 +0530
committerRoopesh Chander <roop@roopc.net>2019-02-22 18:18:53 +0530
commitce405f856e13cd668eb550d3a7acafacf46d3732 (patch)
tree90cabfd3140ba73a5e4819dfbc7d2e888081e446 /WireGuard/WireGuard/UI/macOS
parentmacOS: Replace NSSegmentedControl with NSPopUpButton and NSButton (diff)
downloadwireguard-apple-ce405f856e13cd668eb550d3a7acafacf46d3732.tar.xz
wireguard-apple-ce405f856e13cd668eb550d3a7acafacf46d3732.zip
macOS: When programmatically selecting a tunnel, also scroll if required
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard/UI/macOS')
-rw-r--r--WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift1
1 files changed, 1 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift
index 69802f69..3a298400 100644
--- a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift
+++ b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelsListTableViewController.swift
@@ -242,6 +242,7 @@ class TunnelsListTableViewController: NSViewController {
@discardableResult
private func selectTunnel(at index: Int) -> Bool {
if index < tunnelsManager.numberOfTunnels() {
+ tableView.scrollRowToVisible(index)
tableView.selectRowIndexes(IndexSet(integer: index), byExtendingSelection: false)
return true
}