GNOME Bugzilla – Bug 711720
Highlight if search box text not found in editor
Last modified: 2014-01-25 13:59:52 UTC
Created attachment 259312 [details] [review] Patch Modified the search_box_set_entry_color function of search-box.c. If text is not found the color of text entered in the search box changes to red signifying that it is not present in the editor If a search text is not present in the editor text then there should be some color change in order to tell the user that search text is not found.
Review of attachment 259312 [details] [review]: ::: plugins/document-manager/search-box.c @@ +130,3 @@ if (!found) + { + GdkRGBA red; Please use tabs (not spaces) for indentation and use the indentation scheme used in the file. As I said before, with the default setting of anjuta <Ctrl-I-> indents the selection automatically. @@ +139,3 @@ + gtk_widget_override_color (search_box->priv->search_entry, + GTK_STATE_NORMAL, + &red); Actually, I liked the way with the red background color and white foreground color as it was before. I might be because I am partly color blind and just don't see much difference between red text on white and black text on white.
But if the search text is not found, the search box's background color in my editor is not being changed to red in my editor. In fact it remains the same with white background color and black foreground. I am running the latest version only.
OK, the intention of that code (used to work some time ago) was to change background to red and foreground to white when the text is not found. But I didn't check if it is still working.
Yes, I could comprehend that from the code, but the background is not changing color now. I tried using the function gtk_widget_override_background_color in order to change the bg color, since gtk_widget_modify_base is deprecated now. But still it does not seem to be working. So I changed the foreground color instead using the above patch in order to provide some visible distinction.
(In reply to comment #4) > Yes, I could comprehend that from the code, but the background is not changing > color now. I tried using the function gtk_widget_override_background_color in > order to change the bg color I have tried the following: gtk_widget_override_background_color (search_box->priv->search_entry, GTK_STATE_NORMAL, &red); and I get the read background as expected. I have Gtk 3.9.15
I have upgraded my system and I have seen the issue reported by Kriti. It seems that it's because GtkEntry can use a background image, in this case it's not enough to set only the background color. I have done this using a custom css provider similar to the css used by gedit.