mirror of
https://github.com/TermoraDev/termora.git
synced 2026-01-16 02:12:58 +08:00
fix: OTP dialog width
This commit is contained in:
@@ -12,6 +12,7 @@ import java.awt.Dimension
|
|||||||
import java.awt.Window
|
import java.awt.Window
|
||||||
import javax.swing.JComponent
|
import javax.swing.JComponent
|
||||||
import javax.swing.text.JTextComponent
|
import javax.swing.text.JTextComponent
|
||||||
|
import kotlin.math.max
|
||||||
|
|
||||||
class KeyboardInteractiveDialog(
|
class KeyboardInteractiveDialog(
|
||||||
owner: Window,
|
owner: Window,
|
||||||
@@ -30,7 +31,8 @@ class KeyboardInteractiveDialog(
|
|||||||
|
|
||||||
init()
|
init()
|
||||||
pack()
|
pack()
|
||||||
size = Dimension(300, size.height)
|
size = Dimension(max(300, size.width), size.height)
|
||||||
|
|
||||||
setLocationRelativeTo(null)
|
setLocationRelativeTo(null)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class TerminalUserInteraction(
|
|||||||
true
|
true
|
||||||
)
|
)
|
||||||
dialog.setLocationRelativeTo(owner)
|
dialog.setLocationRelativeTo(owner)
|
||||||
dialog.title = instruction ?: name ?: StringUtils.EMPTY
|
dialog.title = instruction ?: name ?: "OTP"
|
||||||
passwords[i] = dialog.getText()
|
passwords[i] = dialog.getText()
|
||||||
if (passwords[i].isBlank()) {
|
if (passwords[i].isBlank()) {
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user