소스 검색

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