GNOME Bugzilla – Bug 334560
GtkEntry:show-last-char style property
Last modified: 2011-02-04 16:10:23 UTC
Attached patch from maemo-gtk adds a show-last-char style property to GtkEntry which, when set, causes the last inputted character in hidden entries to be shown for 600 ms before it is turned into the invisivle char. I found that feature very useful when entering passwords on the 770, since with the onscreen keyboard i'm never 100% sure if i really hit the key i wanted. It's probably also useful to enable in accessible themes, for people which have the same problem on an ordinary keyboard. Currently, it's a boolean option with a hardcoded timeout, but i wondered if it would be more useful if the property just specified the timeout length, where 0 would disable the feature. Opinions?
Created attachment 61244 [details] [review] Patch implementing the above
makes sense to me to make the timeout duration the variable here. Not really sure if it makes sense as a style property. Feels more like a setting to me.
my take on this is to favour a style proprty timeout defaulting to 0. the reason this should be a style property is that, whether to have an entry operate in password mode or not is a per-entry decision, but the exact appearance/behaviour of the password mode when enabled, is more of a theming/style decision. from multiple entries in password mode on the same desktop, you'd expect the same behaviour, so making this a per object property does not really make sense to me. it might be a good idea to suggest to use the currently implemented 600ms in the property comment, when the default is 0ms.
well, settings are also desktop-wide, and I think this is more of a behaviour question, not a style/appearance question.
Created attachment 61275 [details] [review] Updated patch New patch changes the property to last-char-timeout and uses that value. I'm still not sure on the style vs. settings thing. One the one hand it may be useful to set in accessible themes, on the other it's maybe something the user himself wants to decide globally and theme-independent.
when mclasen said "Feels more like a setting to me." in ä2, i thought he meant a per-entry property. he seems to have been referring to a GtkSettings property though, and i agree that makes sense.
yes, thats what I meant
Created attachment 61692 [details] [review] Changed to GtkSettings::gtk-entry-show-last-char
Fixed in CVS: 2006-03-22 Michael Natterer <mitch@imendio.com> * gtk/gtkentry.c: applied modified patch from maemo-gtk which allows the most recently entered character in a hidden entry to be shown for a configurable period of time. Fixes bug #334560.
hm, while i basically agree to have this in CVS, i can't help but to think that the 4 fields: + gchar last_char[LAST_CHAR_MAX]; + guint last_char_timeout_id; + gint last_char_length; + gint last_char_position; should be moved to qdata, to spare an extra 16bytes for most entries which don't use this feature. can you tackle that mitch?
Hm yea, but I can be picky too... it's in fact 20 bytes :P
Created attachment 61765 [details] [review] Turns 20 bytes of bloat into QData
thanks mitch. the patch looks good to me.
Fixed again: 2006-03-22 Michael Natterer <mitch@imendio.com> * gtk/gtkentry.c: renamed last-char-timeout to password-hint-timeout and store all its data in a struct attached as QData.