mirror of
https://github.com/TermoraDev/termora.git
synced 2026-01-16 02:12:58 +08:00
feat: 弹窗位置以父窗口为中心 (#55)
This commit is contained in:
@@ -68,6 +68,7 @@ class TermoraFrame : JFrame() {
|
||||
FlatDesktop.setPreferencesHandler(that)
|
||||
}
|
||||
})
|
||||
dialog.setLocationRelativeTo(owner)
|
||||
dialog.isVisible = true
|
||||
}
|
||||
}
|
||||
@@ -222,7 +223,9 @@ class TermoraFrame : JFrame() {
|
||||
val focusWindow = KeyboardFocusManager.getCurrentKeyboardFocusManager().focusedWindow
|
||||
val frame = this@TermoraFrame
|
||||
if (focusWindow == frame) {
|
||||
FindEverywhere(frame).isVisible = true
|
||||
val dialog = FindEverywhere(frame)
|
||||
dialog.setLocationRelativeTo(frame)
|
||||
dialog.isVisible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user