sshahine / JFoenix

JavaFX Material Design Library
MIT License
6.27k stars 1.05k forks source link

JFXPasswordField add password entry box to display in clear text #1140

Closed yousiqi closed 3 years ago

yousiqi commented 3 years ago

The default JFXPasswordField cannot see the clear text, and the accuracy of password input cannot be verified. In the modification, the clear text display of password is added and the functions of copying and cutting are supported

GIF

sonarcloud[bot] commented 3 years ago

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

yousiqi commented 3 years ago

thanks for your advice, please check the latest modified code, I think it is very good @jfoenixadmin

jfoenixadmin commented 3 years ago

I was reviewing MD TextField component, it has leading/trailing icons. I think that would be a better implementation as it's more flexible, I also noticed that the icon is part of the text field (the text field line goes under the icon too, unlike your skin implementation). All in all, we need add 2 node properties for those icons inside the control and update the skin implementation (leading/trailing icons can be part of JFXTextFieldSkin, no need to create a custom skin for password field). Thus at the moment, I can only merge the JFXPasswordField.java changes from your PR.

Your PR is appreciated, thank you.

jfoenixadmin commented 3 years ago

Hello, I just pushed bbb653aa222177576ebb8d034adf7b779d832e06. This change allows the user to do the following:

  1. Set leading/trailing graphics for JFXTextField/JFXPassword
  2. JFXPassword has a maskedText property, updating its value will toggle the password mask and the pseudo class "unmasked".

Regards,