[Commits] compose.c 1.382.2.596 1.382.2.597

wwp at claws-mail.org wwp at claws-mail.org
Thu Dec 8 10:01:34 CET 2011


Update of /home/claws-mail/claws/src
In directory claws-mail:/tmp/cvs-serv5535/src

Modified Files:
      Tag: gtk2
	compose.c 
Log Message:
2011-12-08 [wwp]	3.7.10cvs110

	* src/compose.c
	Make "From" widget set independant from recipient lists below,
	so that it doesn't scroll when several recipients headers
	are added and eventually are scrolling the view.
	Path by Christian Hesse <mail at earthworm.de>.
	Fixes bug #2481 'do not scroll "from" dropdown list and sender
	address'.

Index: compose.c
===================================================================
RCS file: /home/claws-mail/claws/src/compose.c,v
retrieving revision 1.382.2.596
retrieving revision 1.382.2.597
diff -u -d -r1.382.2.596 -r1.382.2.597
--- compose.c	18 Nov 2011 21:41:54 -0000	1.382.2.596
+++ compose.c	8 Dec 2011 09:01:31 -0000	1.382.2.597
@@ -6814,12 +6814,27 @@
 static GtkWidget *compose_create_header(Compose *compose) 
 {
 	GtkWidget *from_optmenu_hbox;
+	GtkWidget *header_scrolledwin_main;
+	GtkWidget *header_table_main;
 	GtkWidget *header_scrolledwin;
 	GtkWidget *header_table;
 
-	gint count = 0;
+	/* parent with account selection and from header */
+	header_scrolledwin_main = gtk_scrolled_window_new(NULL, NULL);
+	gtk_widget_show(header_scrolledwin_main);
+	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(header_scrolledwin_main), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
 
-	/* header labels and entries */
+	header_table_main = gtk_table_new(2, 2, FALSE);
+	gtk_widget_show(header_table_main);
+	gtk_container_set_border_width(GTK_CONTAINER(header_table_main), BORDER_WIDTH);
+	gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(header_scrolledwin_main), header_table_main);
+	gtk_viewport_set_shadow_type(GTK_VIEWPORT(gtk_bin_get_child(GTK_BIN((header_scrolledwin_main)))), GTK_SHADOW_NONE);
+
+	from_optmenu_hbox = compose_account_option_menu_create(compose);
+	gtk_table_attach(GTK_TABLE(header_table_main), from_optmenu_hbox,
+				  0, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_SHRINK, 0, 0);
+
+	/* child with header labels and entries */
 	header_scrolledwin = gtk_scrolled_window_new(NULL, NULL);
 	gtk_widget_show(header_scrolledwin);
 	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(header_scrolledwin), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
@@ -6829,23 +6844,19 @@
 	gtk_container_set_border_width(GTK_CONTAINER(header_table), BORDER_WIDTH);
 	gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(header_scrolledwin), header_table);
 	gtk_viewport_set_shadow_type(GTK_VIEWPORT(gtk_bin_get_child(GTK_BIN((header_scrolledwin)))), GTK_SHADOW_NONE);
-	count = 0;
 
-	/* option menu for selecting accounts */
-	from_optmenu_hbox = compose_account_option_menu_create(compose);
-	gtk_table_attach(GTK_TABLE(header_table), from_optmenu_hbox,
-				  0, 2, count, count + 1, GTK_EXPAND | GTK_FILL, GTK_SHRINK, 0, 0);
-	count++;
+	gtk_table_attach(GTK_TABLE(header_table_main), header_scrolledwin,
+				  0, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 2);
 
 	compose->header_table = header_table;
 	compose->header_list = NULL;
-	compose->header_nextrow = count;
+	compose->header_nextrow = 0;
 
 	compose_create_header_entry(compose);
 
-	compose->table	          = NULL;
+	compose->table = NULL;
 
-	return header_scrolledwin ;
+	return header_scrolledwin_main;
 }
 
 static gboolean popup_attach_button_pressed(GtkWidget *widget, gpointer data)
@@ -10147,14 +10158,20 @@
 	GtkTextBuffer *buffer;
 	BLOCK_WRAP();
 	if (compose->focused_editable &&
-	    gtk_widget_has_focus(compose->focused_editable))
+#ifndef GENERIC_UMPC
+	    gtk_widget_has_focus(compose->focused_editable)
+#endif
+		)
 		entry_paste_clipboard(compose, compose->focused_editable, 
 				prefs_common.linewrap_pastes,
 				GDK_SELECTION_CLIPBOARD, NULL);
 	UNBLOCK_WRAP();
 
 #ifdef USE_ENCHANT
-	if (gtk_widget_has_focus(compose->text) &&
+	if (
+#ifndef GENERIC_UMPC
+		gtk_widget_has_focus(compose->text) &&
+#endif
 	    compose->gtkaspell && 
             compose->gtkaspell->check_while_typing)
 	    	gtkaspell_highlight_all(compose->gtkaspell);
@@ -10204,7 +10221,10 @@
 	UNBLOCK_WRAP();
 
 #ifdef USE_ENCHANT
-	if (gtk_widget_has_focus(compose->text) &&
+	if (
+#ifndef GENERIC_UMPC
+		gtk_widget_has_focus(compose->text) &&
+#endif
 	    compose->gtkaspell && 
             compose->gtkaspell->check_while_typing)
 	    	gtkaspell_highlight_all(compose->gtkaspell);
@@ -10227,7 +10247,10 @@
 	UNBLOCK_WRAP();
 
 #ifdef USE_ENCHANT
-	if (gtk_widget_has_focus(compose->text) &&
+	if (
+#ifndef GENERIC_UMPC
+		gtk_widget_has_focus(compose->text) &&
+#endif
 	    compose->gtkaspell &&
             compose->gtkaspell->check_while_typing)
 	    	gtkaspell_highlight_all(compose->gtkaspell);



More information about the Commits mailing list