Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update EnhancedPasswordField functionality and styling #185

Merged
merged 6 commits into from
Jun 10, 2024

Conversation

leewyatt
Copy link
Contributor

@leewyatt leewyatt commented Jun 3, 2024

The EnhancedPasswordField class and its usage have been updated to include CSS pseudo classes for displaying the password. The creation of a simple password field has been simplified to remove unnecessary methods and use better-suited CSS styles for handling the visibility of the password. Moreover, the icon used to toggle the visibility of the password has been changed to be defined in CSS rather than directly in the Java code.

leewyatt added 2 commits June 4, 2024 04:43
The EnhancedPasswordField class and its usage have been updated to include CSS pseudo classes for displaying the password. The creation of a simple password field has been simplified to remove unnecessary methods and use better-suited CSS styles for handling the visibility of the password. Moreover, the icon used to toggle the visibility of the password has been changed to be defined in CSS rather than directly in the Java code.
Switched the listener on showPasswordProperty to a subscribe method in the 'EnhancedPasswordField' class. This change promotes cleaner code structure and improves the readability of the EnhancedPasswordField component's code.
leewyatt added 2 commits June 4, 2024 17:19
The UI elements for EnhancedPasswordField were updated, specifically replacing a FontIcon with a Region, and modifying the CSS styling for these elements. Additionally, toggle functionality was modified to handle mouse click events correctly.
The clickOnNode method in the UIUtil class has been refactored to check if a mouse event is either a single or a multiple primary button click. An overloaded version of the method now accepts a boolean parameter to specify whether the event should be a single click or not. Additionally, minor fixes were done in the comments and format in UIUtil class. The method MouseClicked in EnhancedPasswordField.java was also modified to utilize the new clickOnNode method.
leewyatt added 2 commits June 10, 2024 17:44
This commit renamed the "showing" pseudo class to "showing-password" in the EnhancedPasswordField class. The related CSS rules have been updated accordingly. This naming change provides a clearer understanding of the class's function.
Replaced the setOnMouseClicked event handler with a MOUSE_PRESSED event handler in the EnhancedPasswordField class. This will prevent unwanted event propagation when the rightWrapper node is clicked. Added event.consume() to ensure the event is fully processed.
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

* @return {@code true} if the event is a stable primary button click, {@code false} otherwise.
* @throws NullPointerException if the event is null.
*/
public static boolean clickOnNode(MouseEvent event, boolean isSingleClick) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"isStillSincePressed" can never be "still". "still" means that the mouse has not been moved between the last two pressed events.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your guidance. After testing, it turned out to be exactly as you said. If it is a mouse press or release, the first triggered event always returns false for isStillSincePress.

@dlemmermann dlemmermann merged commit b978584 into master Jun 10, 2024
1 of 2 checks passed
@dlemmermann dlemmermann deleted the enhancment-password-field branch June 10, 2024 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants