diff options
author | Srinivasa Ragavan <sragavan@novell.com> | 2005-12-15 16:27:34 +0800 |
---|---|---|
committer | Srinivasa Ragavan <sragavan@src.gnome.org> | 2005-12-15 16:27:34 +0800 |
commit | 32f88d560f6f1789b4dd740327e8765c893e5970 (patch) | |
tree | f290cb109780cb64c1f1e93db09358388b2964d9 /widgets/misc/e-search-bar.c | |
parent | a95828f5d08145384fcbe7df4c2dccae3e5adee4 (diff) | |
download | gsoc2013-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.c | 26 |
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); |