aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-search-bar.c
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2008-03-15 01:06:02 +0800
committerMilan Crha <mcrha@src.gnome.org>2008-03-15 01:06:02 +0800
commitfd430c412ad7cc5076eeaa9d263ae4de125351e6 (patch)
tree7d39096d59c72459c6d6536816db4a234f13b0dd /widgets/misc/e-search-bar.c
parent39aa517d3c3f9735a01bff49ce8e59add400baf7 (diff)
downloadgsoc2013-evolution-fd430c412ad7cc5076eeaa9d263ae4de125351e6.tar.gz
gsoc2013-evolution-fd430c412ad7cc5076eeaa9d263ae4de125351e6.tar.zst
gsoc2013-evolution-fd430c412ad7cc5076eeaa9d263ae4de125351e6.zip
** Fix for bug #482148
2008-03-14 Milan Crha <mcrha@redhat.com> ** Fix for bug #482148 * e-search-bar.c: (entry_activated_cb), (entry_changed_cb), (search_now_verb_cb), (clear_verb_cb), (clear_button_clicked_cb): Allow clear search when some search is active and text is empty. svn path=/trunk/; revision=35191
Diffstat (limited to 'widgets/misc/e-search-bar.c')
-rw-r--r--widgets/misc/e-search-bar.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/widgets/misc/e-search-bar.c b/widgets/misc/e-search-bar.c
index fa2813da5d..3361e4ea90 100644
--- a/widgets/misc/e-search-bar.c
+++ b/widgets/misc/e-search-bar.c
@@ -215,11 +215,11 @@ search_now_verb_cb (BonoboUIComponent *ui_component,
gtk_widget_modify_text (esb->entry, GTK_STATE_NORMAL, &(style->text[GTK_STATE_SELECTED]));
gtk_widget_modify_base (esb->icon_entry, GTK_STATE_NORMAL, &(style->base[GTK_STATE_SELECTED]));
gtk_widget_modify_base (esb->viewoption, GTK_STATE_NORMAL, &(style->base[GTK_STATE_SELECTED]));
-
} else {
gtk_widget_modify_base (esb->entry, GTK_STATE_NORMAL, NULL);
gtk_widget_modify_text (esb->entry, GTK_STATE_NORMAL, NULL);
gtk_widget_modify_base (esb->icon_entry, GTK_STATE_NORMAL, NULL);
+ gtk_widget_set_sensitive (esb->clear_button, FALSE);
}
g_free (text);
@@ -237,6 +237,7 @@ clear_verb_cb (BonoboUIComponent *ui_component,
gtk_widget_modify_base (esb->entry, GTK_STATE_NORMAL, NULL);
gtk_widget_modify_text (esb->entry, GTK_STATE_NORMAL, NULL);
gtk_widget_modify_base (esb->icon_entry, GTK_STATE_NORMAL, NULL);
+ gtk_widget_set_sensitive (esb->clear_button, FALSE);
clear_search (esb);
gtk_entry_set_text (GTK_ENTRY (esb->entry), "");
@@ -385,6 +386,7 @@ entry_activated_cb (GtkWidget *widget,
gtk_widget_modify_base (esb->entry, GTK_STATE_NORMAL, NULL);
gtk_widget_modify_text (esb->entry, GTK_STATE_NORMAL, NULL);
gtk_widget_modify_base (esb->icon_entry, GTK_STATE_NORMAL, NULL);
+ gtk_widget_set_sensitive (esb->clear_button, FALSE);
}
emit_search_activated (esb);
@@ -400,13 +402,15 @@ entry_changed_cb (GtkWidget *widget,
entry_style = gtk_widget_get_style (esb->entry);
default_style = gtk_widget_get_default_style ();
- if (text && *text)
+ if (text && *text) {
if (gdk_color_equal (&(entry_style->text[GTK_STATE_NORMAL]), &(default_style->text[GTK_STATE_INSENSITIVE])))
gtk_widget_set_sensitive (esb->clear_button, FALSE);
else
gtk_widget_set_sensitive (esb->clear_button, TRUE);
- else
- gtk_widget_set_sensitive (esb->clear_button, FALSE);
+ } else {
+ /* selected color means some search text is active */
+ gtk_widget_set_sensitive (esb->clear_button, gdk_color_equal (&(entry_style->base[GTK_STATE_NORMAL]), &(default_style->base[GTK_STATE_SELECTED])));
+ }
}
static void
@@ -507,6 +511,7 @@ clear_button_clicked_cb (GtkWidget *widget, GdkEventButton *event,
gtk_widget_modify_base (esb->entry, GTK_STATE_NORMAL, NULL);
gtk_widget_modify_text (esb->entry, GTK_STATE_NORMAL, NULL);
gtk_widget_modify_base (esb->icon_entry, GTK_STATE_NORMAL, NULL);
+ gtk_widget_set_sensitive (esb->clear_button, FALSE);
clear_search (esb);
gtk_entry_set_text (GTK_ENTRY (esb->entry), "");