aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-search-bar.c
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@novell.com>2005-12-15 16:27:34 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2005-12-15 16:27:34 +0800
commit32f88d560f6f1789b4dd740327e8765c893e5970 (patch)
treef290cb109780cb64c1f1e93db09358388b2964d9 /widgets/misc/e-search-bar.c
parenta95828f5d08145384fcbe7df4c2dccae3e5adee4 (diff)
downloadgsoc2013-evolution-32f88d560f6f1789b4dd740327e8765c893e5970.tar.gz
gsoc2013-evolution-32f88d560f6f1789b4dd740327e8765c893e5970.tar.zst
gsoc2013-evolution-32f88d560f6f1789b4dd740327e8765c893e5970.zip
Added a visual cue to search bar to indicate search filter active.
2005-12-15 Srinivasa Ragavan <sragavan@novell.com> * Added a visual cue to search bar to indicate search filter active. svn path=/trunk/; revision=30781
Diffstat (limited to 'widgets/misc/e-search-bar.c')
-rw-r--r--widgets/misc/e-search-bar.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/widgets/misc/e-search-bar.c b/widgets/misc/e-search-bar.c
index bb74d311ca..5f322fd25a 100644
--- a/widgets/misc/e-search-bar.c
+++ b/widgets/misc/e-search-bar.c
@@ -259,6 +259,17 @@ static void
entry_activated_cb (GtkWidget *widget,
ESearchBar *esb)
{
+ const char *text = gtk_entry_get_text (esb->entry);
+ GtkStyle *style = gtk_widget_get_default_style ();
+
+ if (text && *text) {
+ gtk_widget_modify_base (esb->entry, GTK_STATE_NORMAL, &(style->base[GTK_STATE_SELECTED]));
+ gtk_widget_modify_text (esb->entry, GTK_STATE_NORMAL, &(style->text[GTK_STATE_SELECTED]));
+ } else {
+ gtk_widget_modify_base (esb->entry, GTK_STATE_NORMAL, NULL);
+ gtk_widget_modify_text (esb->entry, GTK_STATE_NORMAL, NULL);
+ }
+
emit_search_activated (esb);
}
@@ -450,6 +461,16 @@ static void
activate_button_clicked_cb (GtkWidget *widget,
ESearchBar *esb)
{
+ const char *text = gtk_entry_get_text (esb->entry);
+ GtkStyle *style = gtk_widget_get_default_style ();
+
+ if (text && *text) {
+ gtk_widget_modify_base (esb->entry, GTK_STATE_NORMAL, &(style->base[GTK_STATE_SELECTED]));
+ gtk_widget_modify_text (esb->entry, GTK_STATE_NORMAL, &(style->text[GTK_STATE_SELECTED]));
+ } else {
+ gtk_widget_modify_base (esb->entry, GTK_STATE_NORMAL, NULL);
+ gtk_widget_modify_text (esb->entry, GTK_STATE_NORMAL, NULL);
+ }
emit_search_activated (esb);
gtk_widget_grab_focus (esb->entry);
@@ -459,6 +480,11 @@ static void
clear_button_clicked_cb (GtkWidget *widget,
ESearchBar *esb)
{
+ GtkStyle *style = gtk_widget_get_default_style ();
+
+ gtk_widget_modify_base (esb->entry, GTK_STATE_NORMAL, NULL);
+ gtk_widget_modify_text (esb->entry, GTK_STATE_NORMAL, NULL);
+
clear_search (esb);
gtk_widget_grab_focus (esb->entry);