PATCH: Fix mailbox tree hotspot problem



Hi,

 included is a patch that fixes the hotspot position problem in the mailbox
tree. It is caused by the position on dragging being relative to the CList
widget itself, while the position needed for 
must be relative to the GtkScroll widget of the CList.

This patch determines the size of the header and subtracts that from the y
ordinate given to gtk_clist_get_selection_info. If the column headers are
not displayed, the problem never occurred.

So it never really was a hotspot problem.

Melanie
diff -b -B -r -u -P --exclude-from=ignore ../balsa-cvs/src/balsa-mblist.c ./src/balsa-mblist.c
--- ../balsa-cvs/src/balsa-mblist.c	Wed Jul 18 00:16:21 2001
+++ ./src/balsa-mblist.c	Wed Jul 18 15:24:26 2001
@@ -1513,6 +1513,7 @@
     BalsaMailboxNode* mbnode;
     gint row, column;
     gint i;
+	int adjust=0;
     LibBalsaMessage** message_array;
 
 
@@ -1527,7 +1528,12 @@
     g_return_if_fail(messages);
     orig_mailbox = ((LibBalsaMessage*) messages->data)->mailbox;
 
+	/* Adjust for column header size */
+	adjust +=GTK_CLIST(ctree)->column_title_area.height;
+
     /* find the node and mailbox */
+	y-=adjust;
+    
     if (gtk_clist_get_selection_info (GTK_CLIST (ctree), x, y, 
                                       &row, &column)) {
         node = gtk_ctree_node_nth (ctree, row);
@@ -1573,11 +1579,18 @@
 #if 0
     gint row, col;
     gint flag;
+	int adjust=0;
     
     flag = gtk_clist_get_selection_info (GTK_CLIST (mblist), x, y, 
 					 &row, &col);
     
     if (flag) {
+		adjust +=GTK_CLIST(mblist)->column_title_area.height;
+
+	y-=adjust;
+    gtk_clist_get_selection_info (GTK_CLIST (mblist), x, y, 
+					 &row, &col);
+    
 	gtk_signal_handler_block_by_func(GTK_OBJECT (mblist),
 					 GTK_SIGNAL_FUNC (select_mailbox), 
 					 NULL);


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