GNOME Bugzilla – Bug 694831
GtkEntry provides no visual feedback when editable=FALSE
Last modified: 2013-09-18 13:41:05 UTC
Created attachment 237574 [details] [review] Patch 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. Until now, we've solved this problem with the "DeadEntry" widget in libview. I don't know why nobody ever thought to just fix the issue upstream. Here's a patch to do that.
Created attachment 237575 [details] Screenshot of results
It makes a lot of sense to me, visually. Maybe we can implement this in a better way. Benjamin ?
I agree it would be nice to be able to detect that case from the theme and style it differently. I don't think (ab)using the insensitive state for this is a good idea though. I think for how other similar states are implemented in GTK, the best way forward is applying an extra style class (e.g. "read-only" or "inert").
Review of attachment 237574 [details] [review]: make as needswork, accordingly
Created attachment 239505 [details] [review] Implementation which uses a read-only class in the style.
Any feedback on the new implementation?
Review of attachment 239505 [details] [review]: Rather than using style_context_save/restore in draw(), we should add/remove the style class when the editable property is set/unset. Other than that, looks good
Created attachment 245671 [details] [review] Patch v3 OK, the new patch modifies the style context when the property is changed.
Ping?
sorry for the delay, put on my review queue now
Review of attachment 245671 [details] [review]: looks fine
Given that widget states normally map to CSS pseudoclasses (not classes), shouldn't this patch use a pseudoclass as well?
FYI I contributed a fix for Ubuntu's default theme regarding this change: https://bugs.launchpad.net/bugs/1219205 Still, it would be great if I could get some feedback about comment#12 :) Thanks