CVS: sylpheedclaws/sylpheed-claws/src message_search.c,1.3.12.20,1.3.12.21 summary_search.c,1.15.2.38,1.15.2.39

[email protected]
Newsgroups gmane.mail.sylpheed.claws.cvs
Message-ID <[email protected]>
Update of /pack/anoncvs/sylpheedclaws/sylpheed-claws/src
In directory sunsite.dk:/tmp/cvs-serv2572/src

Modified Files:
      Tag: gtk2
	message_search.c summary_search.c 
Log Message:
2006-12-05 [wwp]	2.6.1cvs5

	* src/message_search.c
	* src/summary_search.c
	* src/gtk/combobox.c
	* src/gtk/combobox.h
	* src/gtk/gtkutils.c
	* src/gtk/gtkutils.h
		make up and down arrow keys in modern gtk_combo_box_entry widgets
		behave like w/ old comboboxes (summary and message search only).

Index: message_search.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/message_search.c,v
retrieving revision 1.3.12.20
retrieving revision 1.3.12.21
diff -u -d -r1.3.12.20 -r1.3.12.21
--- message_search.c	2006/12/01 14:03:44	1.3.12.20
+++ message_search.c	2006/12/05 14:59:16	1.3.12.21
@@ -389,8 +389,19 @@
 static gboolean key_pressed(GtkWidget *widget, GdkEventKey *event,
 			    gpointer data)
 {
-	if (event && event->keyval == GDK_Escape)
+	if (event && (event->keyval == GDK_Escape)) {
 		gtk_widget_hide(search_window.window);
+	}
+
+	if (event && (event->keyval == GDK_Down || event->keyval == GDK_Up)) {
+		if (search_window.body_entry_has_focus) {
+			combobox_set_value_from_arrow_key(
+					GTK_COMBO_BOX(search_window.body_entry),
+					event->keyval);
+			return TRUE;
+		}
+	}
+
 	return FALSE;
 }
 

Index: summary_search.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/summary_search.c,v
retrieving revision 1.15.2.38
retrieving revision 1.15.2.39
diff -u -d -r1.15.2.38 -r1.15.2.39
--- summary_search.c	2006/12/01 14:03:44	1.15.2.38
+++ summary_search.c	2006/12/05 14:59:16	1.15.2.39
@@ -948,7 +948,7 @@
 static gboolean key_pressed(GtkWidget *widget, GdkEventKey *event,
 			    gpointer data)
 {
-	if (event && event->keyval == GDK_Escape) {
+	if (event && (event->keyval == GDK_Escape)) {
 		/* ESC key will:
 			- stop a running search
 			- close the search window if no search is running
@@ -959,5 +959,39 @@
 			search_window.is_searching = FALSE;
 		}
 	}
+
+	if (event && (event->keyval == GDK_Down || event->keyval == GDK_Up)) {
+		if (search_window.from_entry_has_focus) {
+			combobox_set_value_from_arrow_key(
+					GTK_COMBO_BOX(search_window.from_entry),
+					event->keyval);
+			return TRUE;
+		}
+		if (search_window.to_entry_has_focus) {
+			combobox_set_value_from_arrow_key(
+					GTK_COMBO_BOX(search_window.to_entry),
+					event->keyval);
+			return TRUE;
+		}
+		if (search_window.subject_entry_has_focus) {
+			combobox_set_value_from_arrow_key(
+					GTK_COMBO_BOX(search_window.subject_entry),
+					event->keyval);
+			return TRUE;
+		}
+		if (search_window.body_entry_has_focus) {
+			combobox_set_value_from_arrow_key(
+					GTK_COMBO_BOX(search_window.body_entry),
+					event->keyval);
+			return TRUE;
+		}
+		if (search_window.adv_condition_entry_has_focus) {
+			combobox_set_value_from_arrow_key(
+					GTK_COMBO_BOX(search_window.adv_condition_entry),
+					event->keyval);
+			return TRUE;
+		}
+	}
+
 	return FALSE;
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.