[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kmail-devel
Subject:    Bug#25037: [PATCH] fixes scrolling problem
From:       Alan Chandler <alan () chandlerfamily ! org ! uk>
Date:       2001-07-22 15:31:51
[Download RAW message or body]

The following is my analysis of this bug.

This bug occurs when then mouse in drag mode enters the folder tree and 
initially is within the small margin around the outside of this pane.  When 
the mouse is subsequently moved inside the margin - if it remains on the 
current item it does not expand because the expand timer was stopped whilst 
the autoscroll takes place and is never restarted because the current item is 
the same as "dropItem".

The bug looks worse, because at 16 units the scroll margin seems to be almost 
as large as last folder - hence we remain in a margin which its trying to 
scroll (but can't because it is fully scrolled) and thus never expand the 
folder tree.

The attached patch is a bit of a "hack" since it

a) halves the size of the scroll margin, and
b) resets the flag which says an item was found

Ideally instead of a) it should notice when we are fully scrolled and remove 
the margin from that side of the "inside_margin" rectange.  

Please review the patch and decide whether the "hack" is sufficient or 
whether we should actually do what I suggest.
-- 

  Alan - alan@chandlerfamily.org.uk
http://www.chandlerfamily.org.uk
["kmail-scroll" (text/x-diff)]

Index: kmfoldertree.cpp
===================================================================
RCS file: /home/kde/kdenetwork/kmail/kmfoldertree.cpp,v
retrieving revision 1.128
diff -u -3 -p -r1.128 kmfoldertree.cpp
--- kmfoldertree.cpp	2001/07/20 19:45:47	1.128
+++ kmfoldertree.cpp	2001/07/22 14:32:01
@@ -1043,7 +1043,7 @@ void KMFolderTree::contentsDragEnterEven
 	     this, SLOT(doFolderSelected(QListViewItem*)));
 }
 
-static const int autoscroll_margin = 16;
+static const int autoscroll_margin = 8;
 static const int initialScrollTime = 30;
 static const int initialScrollAccel = 5;
 
@@ -1107,6 +1107,10 @@ void KMFolderTree::contentsDragMoveEvent
         if ( !inside_margin.contains(vp) ) {
             startAutoScroll();
             e->accept(QRect(0,0,0,0)); // Keep sending move events
+	    // We need to set dropItem to null in case we set it
+	    // in a previous loop round when we were NOT within
+	    // the scroll margin but on the same item.
+	    dropItem=0L;
             autoopen_timer.stop();
         } else {
             e->accept();

_______________________________________________
Kmail Developers mailing list
Kmail@master.kde.org
http://master.kde.org/mailman/listinfo/kmail


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic