Skip to content

Conversation

@fuzzy-one
Copy link

@fuzzy-one fuzzy-one commented Nov 25, 2025

This pull request adds support for customizable password dot characters in the CPasswordInputField widget, allowing users to specify a set of characters (including multi-byte Unicode) to be randomly displayed for each password character. It introduces a new dots_text_change option to control whether the displayed characters change on every update or remain stable. The changes also ensure proper management of text resources and assets associated with these new features.

Password dot customization:

  • Added a new configuration option dots_text_change to the input-field section, allowing users to specify whether the random dot characters should change on each update or remain stable (ConfigManager.cpp, PasswordInputField.cpp, PasswordInputField.hpp). [1] [2] [3] [4]
  • Implemented parsing logic for dots_text_format when specified as a bracketed string (e.g., [abc]), supporting multi-byte Unicode characters and storing them in possibleStrings for random selection (PasswordInputField.cpp). [1] [2]
  • Updated the rendering logic to use the maximum asset size for consistent dot display and to render the randomly selected dot characters per password character (PasswordInputField.cpp). [1] [2]

Resource and asset management:

  • Added logic to request, manage, and unload text resources and assets for each possible dot character, ensuring efficient memory usage and correct updates when the widget is reset or reconfigured (PasswordInputField.cpp). [1] [2] [3]

General improvements:

  • Updated the widget configuration and drawing logic to support the new features, and included necessary header changes (PasswordInputField.cpp, PasswordInputField.hpp).

These changes enhance the flexibility and appearance of password input fields, especially for users who want a more customizable or visually distinct password masking experience.

Usage example

# Random hex digits, stable
input-field {
    dots_text_format = [0123456789ABCDEF]
    dots_text_change = false
}

# Chaotic symbols
input-field {
    dots_text_format = [アイウエオカキクケコサシスセソタチツテトナニヌネノ##@$%^&*!]
    dots_text_change = true
}

Quick demo

video-251125-2149-41.mp4

- Add dots_text_format = [chars] for random chars from array
- Add dots_text_change = true/false for chaotic/stable randomization
- Support Unicode chars (e.g., katakana, symbols)
- Proper UTF-8 parsing and centering for mixed scripts
@fuzzy-one fuzzy-one marked this pull request as ready for review November 25, 2025 20:24
@PaideiaDilemma
Copy link
Collaborator

Hi! Cool feature!
Just a heads up: We are working on porting hyprlock to hyprtoolkit.
This feature will likely have to be re-implemented.
I would be willing to merge it in, but if you are ok with opening this PR again once this is done, it would be easier for me.

@fuzzy-one
Copy link
Author

Hi! Cool feature! Just a heads up: We are working on porting hyprlock to hyprtoolkit. This feature will likely have to be re-implemented. I would be willing to merge it in, but if you are ok with opening this PR again once this is done, it would be easier for me.

For sure, no problem!

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