Fix GtkEntry drawing to provide visual feedback when editable=FALSE.

GtkEntry currently draws exactly the same no matter what the state of the
'editable' property. This is pretty confusing for users because there's
no visual feedback at all, it just seems like their keyboard is broken.

This change adds a "read-only" class to the StyleContext, which will
continue to allow the user to select/copy the text, but will draw the
entry as if it were insensitive, providing some indication that the
contents can't be changed.

Signed-off-by: David Trowbridge <trowbrds@gmail.com>

http://bugzilla.gnome.org/show_bug.cgi?id=694831
This commit is contained in:
David Trowbridge
2013-08-19 13:41:39 -04:00
committed by Matthias Clasen
parent d5e5616ae6
commit a864f9d052
3 changed files with 19 additions and 1 deletions

View File

@ -923,6 +923,12 @@ void gtk_style_context_set_frame_clock (GtkStyleContext *context,
GDK_AVAILABLE_IN_3_8
GdkFrameClock *gtk_style_context_get_frame_clock (GtkStyleContext *context);
/**
* GTK_STYLE_CLASS_READ_ONLY:
*
* A CSS class used to indicate a read-only state.
*/
#define GTK_STYLE_CLASS_READ_ONLY "read-only"
GDK_DEPRECATED_IN_3_8_FOR(gtk_style_context_set_state)
void gtk_style_context_set_direction (GtkStyleContext *context,