瀏覽代碼

simplified the code and removed the function

Jan-Peter Klein 1 年之前
父節點
當前提交
f4007267fb
共有 1 個文件被更改,包括 2 次插入8 次删除
  1. 2 8
      src/main/java/org/cryptomator/ui/unlock/UnlockWorkflow.java

+ 2 - 8
src/main/java/org/cryptomator/ui/unlock/UnlockWorkflow.java

@@ -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);