|
@@ -30,6 +30,7 @@ import org.cryptomator.cryptofs.migration.api.NoApplicableMigratorException;
|
|
|
import org.cryptomator.cryptolib.api.InvalidPassphraseException;
|
|
|
import org.cryptomator.keychain.KeychainAccess;
|
|
|
import org.cryptomator.keychain.KeychainAccessException;
|
|
|
+import org.cryptomator.ui.common.Animations;
|
|
|
import org.cryptomator.ui.common.FxController;
|
|
|
import org.cryptomator.ui.common.FxmlFile;
|
|
|
import org.cryptomator.ui.common.FxmlScene;
|
|
@@ -123,7 +124,7 @@ public class MigrationRunController implements FxController {
|
|
|
window.setScene(successScene.get());
|
|
|
}
|
|
|
}).onError(InvalidPassphraseException.class, e -> {
|
|
|
- shakeWindow();
|
|
|
+ Animations.createShakeWindowAnimation(window).play();
|
|
|
passwordField.selectAll();
|
|
|
passwordField.requestFocus();
|
|
|
vault.setState(VaultState.NEEDS_MIGRATION);
|
|
@@ -176,33 +177,6 @@ public class MigrationRunController implements FxController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /* Animations */
|
|
|
-
|
|
|
- private void shakeWindow() {
|
|
|
- WritableValue<Double> writableWindowX = new WritableValue<>() {
|
|
|
- @Override
|
|
|
- public Double getValue() {
|
|
|
- return window.getX();
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void setValue(Double value) {
|
|
|
- window.setX(value);
|
|
|
- }
|
|
|
- };
|
|
|
- Timeline timeline = new Timeline( //
|
|
|
- new KeyFrame(Duration.ZERO, new KeyValue(writableWindowX, window.getX())), //
|
|
|
- new KeyFrame(new Duration(100), new KeyValue(writableWindowX, window.getX() - 22.0)), //
|
|
|
- new KeyFrame(new Duration(200), new KeyValue(writableWindowX, window.getX() + 18.0)), //
|
|
|
- new KeyFrame(new Duration(300), new KeyValue(writableWindowX, window.getX() - 14.0)), //
|
|
|
- new KeyFrame(new Duration(400), new KeyValue(writableWindowX, window.getX() + 10.0)), //
|
|
|
- new KeyFrame(new Duration(500), new KeyValue(writableWindowX, window.getX() - 6.0)), //
|
|
|
- new KeyFrame(new Duration(600), new KeyValue(writableWindowX, window.getX() + 2.0)), //
|
|
|
- new KeyFrame(new Duration(700), new KeyValue(writableWindowX, window.getX())) //
|
|
|
- );
|
|
|
- timeline.play();
|
|
|
- }
|
|
|
-
|
|
|
/* Getter/Setter */
|
|
|
|
|
|
public Vault getVault() {
|