Pārlūkot izejas kodu

fixed icon views of labels in new password screen that could only appear once

(cherry picked from commit 4723416d45464744c877e52d6aaac7cefad602f6)
Tobias Hagemann 4 gadi atpakaļ
vecāks
revīzija
83f9514a42

+ 9 - 7
main/ui/src/main/java/org/cryptomator/ui/common/NewPasswordController.java

@@ -24,10 +24,12 @@ public class NewPasswordController implements FxController {
 	public NiceSecurePasswordField passwordField;
 	public NiceSecurePasswordField reenterField;
 	public Label passwordStrengthLabel;
+	public FontAwesome5IconView passwordStrengthCheckmark;
+	public FontAwesome5IconView passwordStrengthWarning;
+	public FontAwesome5IconView passwordStrengthCross;
 	public Label passwordMatchLabel;
-	public FontAwesome5IconView checkmark;
-	public FontAwesome5IconView warning;
-	public FontAwesome5IconView cross;
+	public FontAwesome5IconView passwordMatchCheckmark;
+	public FontAwesome5IconView passwordMatchCross;
 
 	public NewPasswordController(ResourceBundle resourceBundle, PasswordStrengthUtil strengthRater, ObjectProperty<CharSequence> password) {
 		this.resourceBundle = resourceBundle;
@@ -45,7 +47,7 @@ public class NewPasswordController implements FxController {
 		BooleanBinding passwordsMatch = Bindings.createBooleanBinding(this::hasSamePasswordInBothFields, passwordField.textProperty(), reenterField.textProperty());
 		BooleanBinding reenterFieldNotEmpty = reenterField.textProperty().isNotEmpty();
 		passwordMatchLabel.visibleProperty().bind(reenterFieldNotEmpty);
-		passwordMatchLabel.graphicProperty().bind(Bindings.when(passwordsMatch.and(reenterFieldNotEmpty)).then(checkmark).otherwise(cross));
+		passwordMatchLabel.graphicProperty().bind(Bindings.when(passwordsMatch.and(reenterFieldNotEmpty)).then(passwordMatchCheckmark).otherwise(passwordMatchCross));
 		passwordMatchLabel.textProperty().bind(Bindings.when(passwordsMatch.and(reenterFieldNotEmpty)).then(resourceBundle.getString("newPassword.passwordsMatch")).otherwise(resourceBundle.getString("newPassword.passwordsDoNotMatch")));
 
 		passwordField.textProperty().addListener(this::passwordsDidChange);
@@ -56,11 +58,11 @@ public class NewPasswordController implements FxController {
 		if (passwordField.getCharacters().length() == 0) {
 			return null;
 		} else if (passwordStrength.intValue() <= -1) {
-			return cross;
+			return passwordStrengthCross;
 		} else if (passwordStrength.intValue() < 3) {
-			return warning;
+			return passwordStrengthWarning;
 		} else {
-			return checkmark;
+			return passwordStrengthCheckmark;
 		}
 	}
 

+ 5 - 3
main/ui/src/main/resources/fxml/new_password.fxml

@@ -12,9 +12,11 @@
 	  spacing="6"
 	  alignment="CENTER_LEFT">
 	<fx:define>
-		<FontAwesome5IconView fx:id="checkmark" styleClass="glyph-icon-primary" glyph="CHECK"/>
-		<FontAwesome5IconView fx:id="warning" styleClass="glyph-icon-orange" glyph="EXCLAMATION_TRIANGLE"/>
-		<FontAwesome5IconView fx:id="cross" styleClass="glyph-icon-red" glyph="TIMES"/>
+		<FontAwesome5IconView fx:id="passwordStrengthCheckmark" styleClass="glyph-icon-primary" glyph="CHECK"/>
+		<FontAwesome5IconView fx:id="passwordStrengthWarning" styleClass="glyph-icon-orange" glyph="EXCLAMATION_TRIANGLE"/>
+		<FontAwesome5IconView fx:id="passwordStrengthCross" styleClass="glyph-icon-red" glyph="TIMES"/>
+		<FontAwesome5IconView fx:id="passwordMatchCheckmark" styleClass="glyph-icon-primary" glyph="CHECK"/>
+		<FontAwesome5IconView fx:id="passwordMatchCross" styleClass="glyph-icon-red" glyph="TIMES"/>
 	</fx:define>
 	<children>
 		<Label text="%newPassword.promptText" labelFor="$passwordField"/>