summaryrefslogtreecommitdiff
blob: b79cbdf152820aa9a53d20a4bf85ab866b52a4e3 (plain)
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
44
45
46
qt-bugs@ issue : 21920 (part of)
applied: no
author: Lubos Lunak <l.lunak@kde.org>

 Run e.g. the iconview example, and try to select 
 items 2, 4 and 6-32 (in this order) only with keyboard. Item 2 can be 
 selected normally, 4 can be selected by holding Ctrl, moving to that item and 
 pressing space, but going to 6, pressing Shift (while Ctrl is still pressed) 
 doesn't work, because it unselects previously selected items. The attached 
 patches for QListBox, QListView and QIconView seem to fix this problem, so 
 that Shift+arrows selecting doesn't unselect anything if Ctrl is pressed.


--- src/iconview/qiconview.cpp.sav	2003-03-04 16:05:25.000000000 +0100
+++ src/iconview/qiconview.cpp	2003-05-06 15:22:14.000000000 +0200
@@ -6266,7 +6266,7 @@ void QIconView::handleItemChange( QIconV
 			    item->selected = TRUE;
 			    selectedRect = selectedRect.unite( item->rect() );
 			}
-		    } else if ( item->selected ) {
+		    } else if ( item->selected && !control ) {
 			item->selected = FALSE;
 			unselectedRect = unselectedRect.unite( item->rect() );
 			changed = TRUE;
--- src/widgets/qlistbox.cpp.sav	2003-03-04 16:05:43.000000000 +0100
+++ src/widgets/qlistbox.cpp	2003-05-06 15:20:24.000000000 +0200
@@ -4540,7 +4540,7 @@ void QListBox::handleItemChange( QListBo
     } else if ( d->selectionMode == Extended ) {
 	if ( shift ) {
 	    selectRange( d->selectAnchor ? d->selectAnchor : old,
-			 d->current, FALSE, TRUE, d->selectAnchor ? TRUE : FALSE );
+			 d->current, FALSE, TRUE, d->selectAnchor && !control ? TRUE : FALSE );
 	} else if ( !control ) {
 	    bool block = signalsBlocked();
 	    blockSignals( TRUE );
--- src/widgets/qlistview.cpp.sav	2003-04-30 18:22:50.000000000 +0200
+++ src/widgets/qlistview.cpp	2003-05-06 15:39:42.000000000 +0200
@@ -6897,7 +6897,7 @@ void QListView::handleItemChange( QListV
     } else if ( d->selectionMode == Extended ) {
 	if ( shift ) {
 	    selectRange( d->selectAnchor ? d->selectAnchor : old,
-			 d->focusItem, FALSE, TRUE, d->selectAnchor ? TRUE : FALSE );
+			 d->focusItem, FALSE, TRUE, d->selectAnchor && !control ? TRUE : FALSE );
 	} else if ( !control ) {
 	    bool block = signalsBlocked();
 	    blockSignals( TRUE );