mirror of
https://github.com/boldsuck/haveno.git
synced 2024-12-22 20:19:21 +00:00
focus on password input in password dialog window
This commit is contained in:
parent
b0fc864313
commit
a00930aa9e
1 changed files with 12 additions and 0 deletions
|
@ -38,6 +38,7 @@ import javafx.scene.image.ImageView;
|
|||
import javafx.scene.layout.VBox;
|
||||
import javafx.scene.paint.Color;
|
||||
import javafx.stage.Stage;
|
||||
import javafx.stage.Window;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.Optional;
|
||||
|
@ -228,6 +229,17 @@ public class HavenoAppMain extends HavenoExecutable {
|
|||
return null;
|
||||
}
|
||||
});
|
||||
|
||||
// Focus the password field when dialog is shown
|
||||
Window window = getDialogPane().getScene().getWindow();
|
||||
if (window instanceof Stage) {
|
||||
Stage dialogStage = (Stage) window;
|
||||
dialogStage.focusedProperty().addListener((observable, oldValue, newValue) -> {
|
||||
if (newValue) {
|
||||
passwordField.requestFocus();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue