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:
@@ -414,7 +414,7 @@ BListView::KeyDown(const char *bytes, int32 numBytes)
|
||||
bool extend
|
||||
= fListType == B_MULTIPLE_SELECTION_LIST
|
||||
&& (modifiers() & B_SHIFT_KEY) != 0;
|
||||
|
||||
|
||||
switch (bytes[0]) {
|
||||
case B_UP_ARROW:
|
||||
{
|
||||
@@ -424,9 +424,9 @@ BListView::KeyDown(const char *bytes, int32 numBytes)
|
||||
} else {
|
||||
if (fAnchorIndex > 0) {
|
||||
if (!extend || fAnchorIndex <= fFirstSelected)
|
||||
Select(fAnchorIndex - 1, extend);
|
||||
Select(--fAnchorIndex, extend);
|
||||
else
|
||||
Deselect(fAnchorIndex);
|
||||
Deselect(fAnchorIndex--);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -441,9 +441,9 @@ BListView::KeyDown(const char *bytes, int32 numBytes)
|
||||
} else {
|
||||
if (fAnchorIndex < CountItems() - 1) {
|
||||
if (!extend || fAnchorIndex >= fLastSelected)
|
||||
Select(fAnchorIndex + 1, extend);
|
||||
Select(++fAnchorIndex, extend);
|
||||
else
|
||||
Deselect(fAnchorIndex);
|
||||
Deselect(fAnchorIndex++);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -456,6 +456,7 @@ BListView::KeyDown(const char *bytes, int32 numBytes)
|
||||
Select(0, fAnchorIndex, true);
|
||||
else
|
||||
Select(0, false);
|
||||
fAnchorIndex = 0;
|
||||
ScrollToSelection();
|
||||
break;
|
||||
case B_END:
|
||||
@@ -463,6 +464,7 @@ BListView::KeyDown(const char *bytes, int32 numBytes)
|
||||
Select(fAnchorIndex, CountItems() - 1, true);
|
||||
else
|
||||
Select(CountItems() - 1, false);
|
||||
fAnchorIndex = CountItems() - 1;
|
||||
ScrollToSelection();
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user