fix: dialog edge detection (#240)

This commit is contained in:
hstyi
2025-02-15 14:15:17 +08:00
committed by GitHub
parent bbf2d50e3f
commit 32d91150bd

View File

@@ -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