Fix some regressions in keyboard shift selection behavior introduced by the last set of changes.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32053 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rene Gollent
2009-08-01 04:20:56 +00:00
parent 1e3ef6135f
commit 51ab53a6ac
+7 -5
View File
@@ -414,7 +414,7 @@ BListView::KeyDown(const char *bytes, int32 numBytes)
bool extend bool extend
= fListType == B_MULTIPLE_SELECTION_LIST = fListType == B_MULTIPLE_SELECTION_LIST
&& (modifiers() & B_SHIFT_KEY) != 0; && (modifiers() & B_SHIFT_KEY) != 0;
switch (bytes[0]) { switch (bytes[0]) {
case B_UP_ARROW: case B_UP_ARROW:
{ {
@@ -424,9 +424,9 @@ BListView::KeyDown(const char *bytes, int32 numBytes)
} else { } else {
if (fAnchorIndex > 0) { if (fAnchorIndex > 0) {
if (!extend || fAnchorIndex <= fFirstSelected) if (!extend || fAnchorIndex <= fFirstSelected)
Select(fAnchorIndex - 1, extend); Select(--fAnchorIndex, extend);
else else
Deselect(fAnchorIndex); Deselect(fAnchorIndex--);
} }
} }
@@ -441,9 +441,9 @@ BListView::KeyDown(const char *bytes, int32 numBytes)
} else { } else {
if (fAnchorIndex < CountItems() - 1) { if (fAnchorIndex < CountItems() - 1) {
if (!extend || fAnchorIndex >= fLastSelected) if (!extend || fAnchorIndex >= fLastSelected)
Select(fAnchorIndex + 1, extend); Select(++fAnchorIndex, extend);
else else
Deselect(fAnchorIndex); Deselect(fAnchorIndex++);
} }
} }
@@ -456,6 +456,7 @@ BListView::KeyDown(const char *bytes, int32 numBytes)
Select(0, fAnchorIndex, true); Select(0, fAnchorIndex, true);
else else
Select(0, false); Select(0, false);
fAnchorIndex = 0;
ScrollToSelection(); ScrollToSelection();
break; break;
case B_END: case B_END:
@@ -463,6 +464,7 @@ BListView::KeyDown(const char *bytes, int32 numBytes)
Select(fAnchorIndex, CountItems() - 1, true); Select(fAnchorIndex, CountItems() - 1, true);
else else
Select(CountItems() - 1, false); Select(CountItems() - 1, false);
fAnchorIndex = CountItems() - 1;
ScrollToSelection(); ScrollToSelection();
break; break;