evolution r35191 - trunk/widgets/misc



Author: mcrha
Date: Fri Mar 14 17:06:02 2008
New Revision: 35191
URL: http://svn.gnome.org/viewvc/evolution?rev=35191&view=rev

Log:
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.



Modified:
   trunk/widgets/misc/ChangeLog
   trunk/widgets/misc/e-search-bar.c

Modified: trunk/widgets/misc/e-search-bar.c
==============================================================================
--- trunk/widgets/misc/e-search-bar.c	(original)
+++ trunk/widgets/misc/e-search-bar.c	Fri Mar 14 17:06:02 2008
@@ -215,11 +215,11 @@
 		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 @@
 	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 @@
 		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_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 @@
 	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), "");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]