Skip to content

Conversation

dfaure
Copy link
Contributor

@dfaure dfaure commented Jul 28, 2025

The implementation and icon come from the material style, given that Qt itself doesn't have that feature.

@ogoffart
Copy link
Member

given that Qt itself doesn't have that feature.

Maybe that's a reason not to merge this. The goal of the Qt style is to integrate into "native" Qt desktop, and if password fields don't have this feature, then we shouldn't have it.
What do you think?

(Implementation looks good otherwise)

@dfaure
Copy link
Contributor Author

dfaure commented Jul 29, 2025

Well, my thinking was that we could do better than Qt :-)
It feels weird that a feature would disappear just by changing the style of a slint app.
In other words, I don't see why slint users should be penalized by the fact that Qt is inferior, when using a slint app.

Also, some people implement this feature on top of Qt (e.g. https://qgis.org/pyqgis/3.40/gui/QgsPasswordLineEdit.html, https://kushaldas.in/posts/creating-password-input-widget-in-pyqt.html) which is exactly what I'm proposing to do here.

The implementation and icon come from the material style,
given that Qt itself doesn't have that feature.
@dfaure dfaure force-pushed the work/dfaure/password-icon-qt-style branch from 7dd40b8 to 4e2871d Compare August 4, 2025 11:01
@dfaure
Copy link
Contributor Author

dfaure commented Aug 15, 2025

@tronical @szecket Any opinion?

BTW I noticed since my last comment that password lineedits in KDE also have a reveal icon.

@tronical
Copy link
Member

Slint defaults to the Qt style only on Linux. On Linux, the Qt style can have a variety of different looks.

The tradeoff I see is between the password icon ruining the appearance with a particular style and the user missing out on the feature of being able to see (toggle) the password in cleartext.

In the most general scope, this seems very risky. If suddenly a QStyle came around the renders a line edit in a significantly different way, the assumptions here about placement and layout might be visually and usability wise bad.

That said, I don’t see massive development on the Linux desktop styling in combination with QStyle. So I think this is a safe patch to apply. Just my two cents :)

@tronical
Copy link
Member

(On a more general note, I tend to agree with the issues about the use of icons outlined here and prefer an overall different design that uses text, which also implies custom controls)

@dfaure
Copy link
Contributor Author

dfaure commented Aug 16, 2025

(I have to disagree with that article. Just because Twitter got it wrong, doesn't mean the rest of the world is pretty much aligned, which is actually one of the recommendations of the article.... Text based solutions are very verbose and eat too much space.
And really, what's the actual problem? Can't people see the actual black-circles taking the place of the password letters? That itself is pretty clear about the current state of things.
The only problem I can see is when it's empty and people start to type. We could decide to fix that by saying that empty always reverts to hidden. Not sure what other implementations do about this though...)

@szecket
Copy link
Member

szecket commented Aug 21, 2025

I think the functionality is nice to have. I think the visual language, while sometimes backwards is just double reinforcement of the dots that appear by default so pressing the button just toggles the current state. They all can be confusing given the right context.

@ogoffart ogoffart added this to the 1.14 milestone Sep 9, 2025
@dfaure
Copy link
Contributor Author

dfaure commented Sep 16, 2025

Is there any reason left for this not to be merged?

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.

4 participants