stepanzubkov / where-is-my-sddm-theme

:eyes: The most minimalistic and highly customizable SDDM theme.
MIT License
191 stars 10 forks source link

Emojis as `passwordCharacter` #38

Open pinarruiz opened 1 month ago

pinarruiz commented 1 month ago

Hi,

I was wondering if its possible to get emojis as password characters, i have tried some color emojis to no avail, i get those squares with ? instead of the emoji itself, i also tried changing the font family on Main.qml#L214 but still no luck.

Thanks

stepanzubkov commented 1 month ago

Hi, I noticed that I can set password character to emoji, but only in source code:

text: "\u263A"
font.family: "Noto Color Emoji"

I got: Снимок экрана_20240727_130526

But if I set passwordCharacter=\u263A in theme.conf, this will not work, because config.stringValue("passwordCharacter") returns "263A", not "\u263A". It's probably a SDDM bug or my lack of QML knowledge.

The only way I see now is check the length of passwordCharacter and apply "\u" to it, if its length > 1.

pinarruiz commented 1 month ago

Hi @stepanzubkov just tried this and it works, I am trying to make it work with longer unicode emojis like 🌀 (1F300) so far i have discovered that you can apparently use JS on qml, so i will see if i can make a PR with the detection of the unicode character and see how that goes.

For longer unicode emojis, i have discovered this function String.fromCodePoint(0x1F300) from this StackOverflow answer but i still cannot get it to work.


String.fromCodePoint() Reference