aboutsummaryrefslogtreecommitdiff
path: root/x11-toolkits/qt33/files/0015-qiconview-finditem.patch
blob: 1c02622972fe86982fafc8c2fcdae89f10c8f15a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
qt-bugs@ issue : 18886
applied: no
author: Pascal Létourneau <pletourn@globetrotter.net>

QIconView::findItem() should always search all ItemContainer to find the best 
match.

Example:

-----        -----
|   |        |   |       ItemContainer
--------------------------------------
|   |        |   |       boundary
|   | -----  |   |
|   | |   |  |   |
----- -----  -----
item1 item2  item3

Right now, the focus goes from item1 to item3 when you press Key_Right.

[ Since the mail was sent, I added the diff 'contains -> intersects' ]

Index: src/iconview/qiconview.cpp
===================================================================
RCS file: /home/kde/qt-copy/src/iconview/qiconview.cpp,v
retrieving revision 1.47
diff -u -3 -p -r1.47 qiconview.cpp
--- src/iconview/qiconview.cpp	16 May 2003 13:02:38 -0000	1.47
+++ src/iconview/qiconview.cpp	30 May 2003 20:32:34 -0000
@@ -5200,11 +5201,11 @@ QIconViewItem* QIconView::findItem( Dire
 	d->findContainers( dir, relativeTo, searchRect);
 
     cList->first();
-    while ( cList->current() && !centerMatch ) {
+    while ( cList->current() ) {
 	QPtrList<QIconViewItem> &list = (cList->current())->items;
 	for ( item = list.first(); item; item = list.next() ) {
 	    if ( neighbourItem( dir, relativeTo, item ) &&
-		 searchRect.contains( item->rect().center() ) &&
+		 searchRect.intersects( item->rect() ) &&
 		 item != currentItem() ) {
  		int ml = (relativeTo - item->rect().center()).manhattanLength();
 		if ( centerMatch ) {