After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 334560 - GtkEntry:show-last-char style property
GtkEntry:show-last-char style property
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2006-03-14 19:02 UTC by Michael Natterer
Modified: 2011-02-04 16:10 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch implementing the above (7.01 KB, patch)
2006-03-14 19:04 UTC, Michael Natterer
none Details | Review
Updated patch (7.23 KB, patch)
2006-03-15 09:56 UTC, Michael Natterer
none Details | Review
Changed to GtkSettings::gtk-entry-show-last-char (6.93 KB, patch)
2006-03-21 14:56 UTC, Michael Natterer
committed Details | Review
Turns 20 bytes of bloat into QData (6.99 KB, patch)
2006-03-22 14:55 UTC, Michael Natterer
committed Details | Review

Description Michael Natterer 2006-03-14 19:02:21 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?
Comment 1 Michael Natterer 2006-03-14 19:04:50 UTC
Created attachment 61244 [details] [review]
Patch implementing the above
Comment 2 Matthias Clasen 2006-03-14 19:19:11 UTC
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.
Comment 3 Tim Janik 2006-03-14 19:59:35 UTC
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. 
Comment 4 Matthias Clasen 2006-03-15 02:13:07 UTC
well, settings are also desktop-wide, and I think this is more of a behaviour
question, not a style/appearance question. 
Comment 5 Michael Natterer 2006-03-15 09:56:10 UTC
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.
Comment 6 Tim Janik 2006-03-15 16:21:28 UTC
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.
Comment 7 Matthias Clasen 2006-03-15 16:24:09 UTC
yes, thats what I meant
Comment 8 Michael Natterer 2006-03-21 14:56:34 UTC
Created attachment 61692 [details] [review]
Changed to GtkSettings::gtk-entry-show-last-char
Comment 9 Michael Natterer 2006-03-22 14:07:13 UTC
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.
Comment 10 Tim Janik 2006-03-22 14:15:07 UTC
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?
Comment 11 Michael Natterer 2006-03-22 14:23:27 UTC
Hm yea, but I can be picky too... it's in fact 20 bytes :P
Comment 12 Michael Natterer 2006-03-22 14:55:49 UTC
Created attachment 61765 [details] [review]
Turns 20 bytes of bloat into QData
Comment 13 Tim Janik 2006-03-22 15:07:04 UTC
thanks mitch. the patch looks good to me.
Comment 14 Michael Natterer 2006-03-22 16:19:02 UTC
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.