From 3cbe8d153720f24e732cf67f471b130f119002b1 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Mon, 21 Nov 2022 16:21:30 +0200 Subject: [PATCH] set initial focus to done button on terminal server test dialog --- .../sparrow/terminal/preferences/ServerTestDialog.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/terminal/preferences/ServerTestDialog.java b/src/main/java/com/sparrowwallet/sparrow/terminal/preferences/ServerTestDialog.java index 61324249..d33c28af 100644 --- a/src/main/java/com/sparrowwallet/sparrow/terminal/preferences/ServerTestDialog.java +++ b/src/main/java/com/sparrowwallet/sparrow/terminal/preferences/ServerTestDialog.java @@ -51,7 +51,9 @@ public class ServerTestDialog extends DialogWindow { buttonPanel.setLayoutManager(new GridLayout(3).setHorizontalSpacing(1)); buttonPanel.addComponent(new Button("Back", this::onBack).setLayoutData(GridLayout.createLayoutData(GridLayout.Alignment.CENTER, GridLayout.Alignment.CENTER, false, false))); buttonPanel.addComponent(new Button("Test", this::onTest).setLayoutData(GridLayout.createLayoutData(GridLayout.Alignment.CENTER, GridLayout.Alignment.CENTER, true, false))); - buttonPanel.addComponent(new Button("Done", this::onDone)); + Button doneButton = new Button("Done", this::onDone); + buttonPanel.addComponent(doneButton); + SparrowTerminal.get().getGuiThread().invokeLater(doneButton::takeFocus); mainPanel.addComponent(new EmptySpace(TerminalSize.ONE));