fix: double-click to open the host (#529)

This commit is contained in:
hstyi
2025-04-26 09:45:42 +08:00
committed by GitHub
parent 0ba6ac3305
commit 06e9a89e82

View File

@@ -135,6 +135,7 @@ class NewHostTree : SimpleTree() {
// double click
addMouseListener(object : MouseAdapter() {
override fun mouseClicked(e: MouseEvent) {
if (getPathForLocation(e.x, e.y) == null) return
if (doubleClickConnection && SwingUtilities.isLeftMouseButton(e) && e.clickCount % 2 == 0) {
val lastNode = lastSelectedPathComponent as? HostTreeNode ?: return
if (lastNode.host.protocol != Protocol.Folder) {