[Commits] gtkcmctree.c 1.1.2.31 1.1.2.32 gtksctree.c 1.1.4.64 1.1.4.65

colin at claws-mail.org colin at claws-mail.org
Fri Oct 12 14:47:29 CEST 2012


Update of /home/claws-mail/claws/src/gtk
In directory srv:/tmp/cvs-serv12416/src/gtk

Modified Files:
      Tag: gtk2
	gtkcmctree.c gtksctree.c 
Log Message:
2012-10-12 [colin]	3.8.1cvs96

	* src/gtk/gtkcmctree.c
	* src/gtk/gtksctree.c
		Fix bug #2581, "expander arrows are too tiny to hit with the 
		mouse". Patch mostly by Tom Horsley

Index: gtksctree.c
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/gtksctree.c,v
retrieving revision 1.1.4.64
retrieving revision 1.1.4.65
diff -u -d -r1.1.4.64 -r1.1.4.65
--- gtksctree.c	27 May 2012 17:31:06 -0000	1.1.4.64
+++ gtksctree.c	12 Oct 2012 12:47:27 -0000	1.1.4.65
@@ -418,6 +418,7 @@
   GtkCMCTree *ctree;
   gint xl, xmax;
   gint yu;
+  gint hotspot_size;
   
   cm_return_val_if_fail (GTK_IS_SCTREE (sctree), FALSE);
   cm_return_val_if_fail (node != NULL, FALSE);
@@ -431,41 +432,45 @@
 
   tree_row = GTK_CMCTREE_ROW (node);
 
+  hotspot_size = clist->row_height-2;
+  if (hotspot_size > clist->column[ctree->tree_column].area.width - 2)
+	hotspot_size = clist->column[ctree->tree_column].area.width - 2;
+
   if (!GTK_CMCLIST_ROW_HEIGHT_SET(GTK_CMCLIST(clist)))
-     yu = (ROW_TOP_YPIXEL (clist, row) + (clist->row_height - PM_SIZE) / 2 -
+     yu = (ROW_TOP_YPIXEL (clist, row) + (clist->row_height - hotspot_size) / 2 -
 	(clist->row_height - 1) % 2);
   else
-     yu = (ROW_TOP_YPIXEL (clist, row) + (clist->row_height/2 - PM_SIZE) / 2 -
+     yu = (ROW_TOP_YPIXEL (clist, row) + (clist->row_height/2 - hotspot_size) / 2 -
 	(clist->row_height/2 - 1) % 2);
 
 #ifndef GENERIC_UMPC
   if (clist->column[ctree->tree_column].justification == GTK_JUSTIFY_RIGHT)
     xl = clist->column[ctree->tree_column].area.x + 
 	  clist->column[ctree->tree_column].area.width - 1 + clist->hoffset -
-	  (tree_row->level - 1) * ctree->tree_indent - PM_SIZE;
+	  (tree_row->level - 1) * ctree->tree_indent - hotspot_size;
   else
     xl = clist->column[ctree->tree_column].area.x + clist->hoffset +
 	  (tree_row->level - 1) * ctree->tree_indent;
 
-  xmax = xl + PM_SIZE;
+  xmax = xl + hotspot_size;
 #else
   if (clist->column[ctree->tree_column].justification == GTK_JUSTIFY_RIGHT) {
     xl = clist->column[ctree->tree_column].area.x + 
 	  clist->column[ctree->tree_column].area.width - 1 + clist->hoffset -
-	  (tree_row->level - 1) * ctree->tree_indent - PM_SIZE;
-    xmax = xl + PM_SIZE;
+	  (tree_row->level - 1) * ctree->tree_indent - hotspot_size;
+    xmax = xl + hotspot_size;
   } else if (ctree->tree_column == 0) {
     xl = clist->column[ctree->tree_column].area.x + clist->hoffset;
     xmax = clist->column[ctree->tree_column].area.x + clist->hoffset +
 	   (tree_row->level - 1) * ctree->tree_indent +
-	   PM_SIZE;
+	   hotspot_size;
   } else {
     xl = clist->column[ctree->tree_column].area.x + clist->hoffset +
 	  (tree_row->level - 1) * ctree->tree_indent;
-    xmax = xl + PM_SIZE;
+    xmax = xl + hotspot_size;
   }
 #endif
-  return (x >= xl && x <= xmax && y >= yu && y <= yu + PM_SIZE);
+  return (x >= xl && x <= xmax && y >= yu && y <= yu + hotspot_size);
 }
 
 gboolean

Index: gtkcmctree.c
===================================================================
RCS file: /home/claws-mail/claws/src/gtk/Attic/gtkcmctree.c,v
retrieving revision 1.1.2.31
retrieving revision 1.1.2.32
diff -u -d -r1.1.2.31 -r1.1.2.32
--- gtkcmctree.c	16 Sep 2012 21:56:21 -0000	1.1.2.31
+++ gtkcmctree.c	12 Oct 2012 12:47:27 -0000	1.1.2.32
@@ -2910,7 +2910,8 @@
   GtkCMCList *clist;
   gint xl;
   gint yu;
-  
+  gint hotspot_size;
+
   cm_return_val_if_fail (GTK_IS_CMCTREE (ctree), FALSE);
   cm_return_val_if_fail (node != NULL, FALSE);
 
@@ -2922,18 +2923,22 @@
 
   tree_row = GTK_CMCTREE_ROW (node);
 
-  yu = (ROW_TOP_YPIXEL (clist, row) + (clist->row_height - PM_SIZE) / 2 -
+  hotspot_size = clist->row_height-2;
+  if (hotspot_size > clist->column[ctree->tree_column].area.width - 2)
+	hotspot_size = clist->column[ctree->tree_column].area.width - 2;
+
+  yu = (ROW_TOP_YPIXEL (clist, row) + (clist->row_height - hotspot_size) / 2 -
 	(clist->row_height - 1) % 2);
 
   if (clist->column[ctree->tree_column].justification == GTK_JUSTIFY_RIGHT)
     xl = (clist->column[ctree->tree_column].area.x + 
 	  clist->column[ctree->tree_column].area.width - 1 + clist->hoffset -
-	  (tree_row->level - 1) * ctree->tree_indent - PM_SIZE);
+	  (tree_row->level - 1) * ctree->tree_indent - hotspot_size);
   else
     xl = (clist->column[ctree->tree_column].area.x + clist->hoffset +
 	  (tree_row->level - 1) * ctree->tree_indent);
 
-  return (x >= xl && x <= xl + PM_SIZE && y >= yu && y <= yu + PM_SIZE);
+  return (x >= xl && x <= xl + hotspot_size && y >= yu && y <= yu + hotspot_size);
 }
 
 /***********************************************************



More information about the Commits mailing list