fix: OTP dialog width

This commit is contained in:
hstyi
2025-06-21 17:05:16 +08:00
committed by hstyi
parent e1eab9db06
commit bb39178b88
2 changed files with 4 additions and 2 deletions

View File

@@ -12,6 +12,7 @@ import java.awt.Dimension
import java.awt.Window
import javax.swing.JComponent
import javax.swing.text.JTextComponent
import kotlin.math.max
class KeyboardInteractiveDialog(
owner: Window,
@@ -30,7 +31,8 @@ class KeyboardInteractiveDialog(
init()
pack()
size = Dimension(300, size.height)
size = Dimension(max(300, size.width), size.height)
setLocationRelativeTo(null)
}

View File

@@ -29,7 +29,7 @@ class TerminalUserInteraction(
true
)
dialog.setLocationRelativeTo(owner)
dialog.title = instruction ?: name ?: StringUtils.EMPTY
dialog.title = instruction ?: name ?: "OTP"
passwords[i] = dialog.getText()
if (passwords[i].isBlank()) {
break