GNOME Bugzilla – Bug 113561
Don't leave garbage in colorsel hex_entry
Last modified: 2013-02-11 05:12:02 UTC
If the user types in unparsable garbage and presses enter, the color isn't updated (ok), but the garbage is left in place. It would be more consistent to always replace the current content of the hex entry with the hex value of the current color when the user presses enter.
Created attachment 16749 [details] [review] a patch
Sounds reasonable to me if we don't want to go to all the way and pop up a dialog (and dialogs on focus out are typically a bad idea) I'm wondering if addition to restoring the current color we should grab_focus() and select_all() So: A) It's clear that something happened B) The user can try again easily.
We could even beep :-). Unfortunately, grab_focus() from a focus_out handler doesn't seem to work very well. And playing around with this some more, I'm not convinced that it makes the error really obvious, unless we beep. Maybe an error dialog is a better idea.
Let's see if the usability folks have any ideas here about what the best behavior is for invalid entries in the 'color name' field. [I think we should try to make gtk_widget_grab_focus() in focus out work, while it's frequently a bit questionable to prevent focus-out, it's something that people have asked about on gtk-list multiple times. ]
Isn't garbage most likely to be a typo? If so you'd want to leave it there so the user could fix it. If we ever close that bug about GtkEntry validation, we could just use the validation feature. ;-)
I have to agree with havoc that this should probably be handled as a use case for entry validation.
closing old bugs