From 32d91150bd030463d8262086b4f6debdae137d90 Mon Sep 17 00:00:00 2001 From: hstyi Date: Sat, 15 Feb 2025 14:15:17 +0800 Subject: [PATCH] fix: dialog edge detection (#240) --- src/main/kotlin/app/termora/transport/FileSystemTabbed.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/kotlin/app/termora/transport/FileSystemTabbed.kt b/src/main/kotlin/app/termora/transport/FileSystemTabbed.kt index 44790a4..5a2bc0d 100644 --- a/src/main/kotlin/app/termora/transport/FileSystemTabbed.kt +++ b/src/main/kotlin/app/termora/transport/FileSystemTabbed.kt @@ -58,9 +58,8 @@ class FileSystemTabbed( private fun initEvents() { addBtn.addActionListener { val dialog = HostTreeDialog(SwingUtilities.getWindowAncestor(this)) - dialog.location = Point( - addBtn.locationOnScreen.x - dialog.width / 2 + addBtn.width / 2, + max(0, addBtn.locationOnScreen.x - dialog.width / 2 + addBtn.width / 2), addBtn.locationOnScreen.y + max(tabHeight, addBtn.height) ) dialog.isVisible = true