simplified the code and removed the function

This commit is contained in:
Jan-Peter Klein
2024-02-16 17:31:20 +01:00
parent 155ba4607b
commit f4007267fb

View File

@@ -104,13 +104,6 @@ public class UnlockWorkflow extends Task<Void> {
appWindows.showErrorWindow(e, window, null);
}
private void centerOnPrimaryStage(Window window){
double centerXPosition = mainWindow.getX() + (mainWindow.getWidth() - window.getWidth()) / 2;
double centerYPosition = mainWindow.getY() + (mainWindow.getHeight() - window.getHeight()) / 2;
window.setX(centerXPosition);
window.setY(centerYPosition);
}
@Override
protected void succeeded() {
LOG.info("Unlock of '{}' succeeded.", vault.getDisplayName());
@@ -119,7 +112,8 @@ public class UnlockWorkflow extends Task<Void> {
case ASK -> Platform.runLater(() -> {
window.setScene(successScene.get());
window.show();
centerOnPrimaryStage(window);
window.setX(mainWindow.getX() + (mainWindow.getWidth() - window.getWidth()) / 2);
window.setY(mainWindow.getY() + (mainWindow.getHeight() - window.getHeight()) / 2);
});
case REVEAL -> {
Platform.runLater(window::close);