Sophie

Sophie

distrib > Mandriva > 2006.0 > x86_64 > by-pkgid > cc8f970be8f3f9d917634bf75d52343e > files > 8

qt3-3.3.4-23mdk.src.rpm

qt-bugs@ issue : 26009
bugs.kde.org number : 35203
applied: no
author: Clarence Dang <dang@kde.org>

Subject: Unable to drag icons a small distance in QIconView (Re: Several suggestions to make KDE desktop look/behave nicer)
From: Clarence Dang <dang@kde.org>
To: qt-bugs@trolltech.com
CC: kde-usability@mail.kde.org
Date: Thu, 3 Jul 2003 23:09:24 +1000


Hi Trolltech,

On Fri, 27 Jun 2003 08:42 pm, Michael Pye wrote:
> On Friday 27 Jun 2003 8:24 am, Clarence Dang wrote:
> > On Fri, 27 Jun 2003 09:18 am, Ivica Bukvic wrote:
[about the QIconView-based KDE Desktop]
> > > 4) Icon dragging often fails if the icons are dragged a short distance,
> > > even if the auto-allign options are turned off -- this is quite
> > > annoying. Users should be able to move icons however and wherever
> > >they prefer, without fighting the UI.
> >
> > Yeah, I get that too even with "Drag Start Distance" set to 1.  So to
> > move an icon just a little bit, I have to move it far away and then back
> > to where I want it.  I'll have a look into this.
>
> As far as I can tell, the icon does not move unless the pointer finishes
> outside the bounds of the icon's original position.
That was it, thanks.  AFAICS, QIconView tries to prevent you from moving an 
icon on top of another icon.  But, in this case, when you're moving an icon 
just a little bit, the icon it "lands on top of" is the icon being dragged.

So, here's a patch.  There are still some slight bugs to do with really, 
really tiny drags but I don't have time to investigate them right now.

Cheers,
Clarence

[this patch is slightly different from the one sent to TT - a redundant
check was removed]

Index: src/iconview/qiconview.cpp
===================================================================
RCS file: /home/kde/qt-copy/src/iconview/qiconview.cpp,v
retrieving revision 1.49
diff -u -p -r1.49 qiconview.cpp
--- src/iconview/qiconview.cpp	1 Jul 2003 23:06:42 -0000	1.49
+++ src/iconview/qiconview.cpp	23 Jul 2003 05:19:28 -0000
@@ -4770,7 +4770,7 @@ void QIconView::contentsDropEvent( QDrop
 
     QIconViewItem *i = findItem( e->pos() );
 
-    if ( !i && e->source() == viewport() && d->currentItem && !d->cleared ) {
+    if ( (!i || i == d->currentItem) && e->source() == viewport() && d->currentItem && !d->cleared ) {
 	if ( !d->rearrangeEnabled )
 	    return;
 	QRect r = d->currentItem->rect();