2012-10-12 [colin] 3.8.1cvs96
authorColin Leroy <colin@colino.net>
Fri, 12 Oct 2012 12:47:27 +0000 (12:47 +0000)
committerColin Leroy <colin@colino.net>
Fri, 12 Oct 2012 12:47:27 +0000 (12:47 +0000)
* 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

ChangeLog
PATCHSETS
configure.ac
src/gtk/gtkcmctree.c
src/gtk/gtksctree.c

index 8d6d7f3..2039f70 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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
+
 2012-10-12 [iwkse]     3.8.1cvs95
 
        * src/common/utils.c
index dd80d9a..86055da 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.382.2.615 -r 1.382.2.616 src/compose.c;  cvs diff -u -r 1.105.2.177 -r 1.105.2.178 src/prefs_account.c;  cvs diff -u -r 1.36.2.203 -r 1.36.2.204 src/common/utils.c;  cvs diff -u -r 1.20.2.80 -r 1.20.2.81 src/common/utils.h;  ) > 3.8.1cvs93.patchset
 ( cvs diff -u -r 1.36.2.204 -r 1.36.2.205 src/common/utils.c;  ) > 3.8.1cvs94.patchset
 ( cvs diff -u -r 1.36.2.205 -r 1.36.2.206 src/common/utils.c;  ) > 3.8.1cvs95.patchset
+( cvs diff -u -r 1.1.2.31 -r 1.1.2.32 src/gtk/gtkcmctree.c;  cvs diff -u -r 1.1.4.64 -r 1.1.4.65 src/gtk/gtksctree.c;  ) > 3.8.1cvs96.patchset
index 39275d1..62034eb 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=95
+EXTRA_VERSION=96
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 5e81c98..a88f365 100644 (file)
@@ -2910,7 +2910,8 @@ ctree_is_hot_spot (GtkCMCTree     *ctree,
   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 @@ ctree_is_hot_spot (GtkCMCTree     *ctree,
 
   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);
 }
 
 /***********************************************************
index e7fceff..2861ea0 100644 (file)
@@ -418,6 +418,7 @@ sctree_is_hot_spot (GtkSCTree     *sctree,
   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 @@ sctree_is_hot_spot (GtkSCTree     *sctree,
 
   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