Browse Source

unset and set default buttons to make sure VK_ENTER triggers it

Sebastian Stenzel 8 years ago
parent
commit
76c9a19428

+ 3 - 0
main/ui/src/main/java/org/cryptomator/ui/controllers/ChangePasswordController.java

@@ -122,6 +122,9 @@ public class ChangePasswordController extends LocalizedFXMLViewController {
 		oldPasswordField.clear();
 		newPasswordField.clear();
 		retypePasswordField.clear();
+		// trigger "default" change to refresh key bindings:
+		changePasswordButton.setDefaultButton(false);
+		changePasswordButton.setDefaultButton(true);
 	}
 
 	// ****************************************

+ 3 - 0
main/ui/src/main/java/org/cryptomator/ui/controllers/InitializeController.java

@@ -108,6 +108,9 @@ public class InitializeController extends LocalizedFXMLViewController {
 	private void vaultDidChange(Vault newVault) {
 		passwordField.clear();
 		retypePasswordField.clear();
+		// trigger "default" change to refresh key bindings:
+		okButton.setDefaultButton(false);
+		okButton.setDefaultButton(true);
 	}
 
 	// ****************************************

+ 3 - 0
main/ui/src/main/java/org/cryptomator/ui/controllers/UnlockController.java

@@ -149,6 +149,9 @@ public class UnlockController extends LocalizedFXMLViewController {
 		if (SystemUtils.IS_OS_WINDOWS) {
 			chooseSelectedDriveLetter();
 		}
+		// trigger "default" change to refresh key bindings:
+		unlockButton.setDefaultButton(false);
+		unlockButton.setDefaultButton(true);
 	}
 
 	// ****************************************

+ 2 - 2
main/ui/src/main/java/org/cryptomator/ui/controllers/UpgradeController.java

@@ -58,7 +58,7 @@ public class UpgradeController extends LocalizedFXMLViewController {
 			return instruction.map(this::upgradeNotification).orElse("");
 		}).orElse(""));
 
-		EasyBind.subscribe(vault, this::vaultChanged);
+		EasyBind.subscribe(vault, this::vaultDidChange);
 	}
 
 	@Override
@@ -66,7 +66,7 @@ public class UpgradeController extends LocalizedFXMLViewController {
 		return getClass().getResource("/fxml/upgrade.fxml");
 	}
 
-	private void vaultChanged(Vault newVault) {
+	private void vaultDidChange(Vault newVault) {
 		errorLabel.setText(null);
 	}