diff options
author | Milan Crha <mcrha@redhat.com> | 2008-03-15 01:06:02 +0800 |
---|---|---|
committer | Milan Crha <mcrha@src.gnome.org> | 2008-03-15 01:06:02 +0800 |
commit | fd430c412ad7cc5076eeaa9d263ae4de125351e6 (patch) | |
tree | 7d39096d59c72459c6d6536816db4a234f13b0dd | |
parent | 39aa517d3c3f9735a01bff49ce8e59add400baf7 (diff) | |
download | gsoc2013-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
-rw-r--r-- | widgets/misc/ChangeLog | 8 | ||||
-rw-r--r-- | widgets/misc/e-search-bar.c | 13 |
2 files changed, 17 insertions, 4 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog index 6186c3dbf6..2ffc48f718 100644 --- a/widgets/misc/ChangeLog +++ b/widgets/misc/ChangeLog @@ -1,3 +1,11 @@ +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. + 2008-03-13 Milan Crha <mcrha@redhat.com> ** Fix for bug #460204 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), ""); |