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 566741 - add placeholder text support to GtkEntry
add placeholder text support to GtkEntry
Status: RESOLVED DUPLICATE of bug 440963
Product: gtk+
Classification: Platform
Component: Widget: GtkEntry
2.15.x
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2009-01-06 09:05 UTC by Claudio Saavedra
Modified: 2009-01-06 14:36 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
initial patch (7.35 KB, patch)
2009-01-06 09:08 UTC, Claudio Saavedra
needs-work Details | Review

Description Claudio Saavedra 2009-01-06 09:05:13 UTC
For some time, we've seen this being done in many text entries: the search entry in firefox, the search field in evolution, etc. Having a placeholder text, that is only visible when the entry is not focused and empty and acts only as an indicator of the nature of the input expected, looks like an interesting feature to have in GtkEntry.

I will attach an initial patch to implement this. It works fine but in RTL environments seems to break. What still needs to be improved is the positioning of the text layout, as this is currently (ab)using the position for the normal text. I'd appreciate some guidance on this in order to finish the patch.
Comment 1 Claudio Saavedra 2009-01-06 09:08:31 UTC
Created attachment 125837 [details] [review]
initial patch

This patch adds the "placeholder-text" property, accessors, and the initial implementation. I modified the entry completion demo in gtk-demo as a simple example.
Comment 2 Matthias Clasen 2009-01-06 14:36:14 UTC

*** This bug has been marked as a duplicate of 440963 ***