From 51ab53a6acdc73da793390695fc4a5edb97fceb4 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Sat, 1 Aug 2009 04:20:56 +0000 Subject: [PATCH] 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 --- src/kits/interface/ListView.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/kits/interface/ListView.cpp b/src/kits/interface/ListView.cpp index 2088230cd0..26af4765f3 100644 --- a/src/kits/interface/ListView.cpp +++ b/src/kits/interface/ListView.cpp @@ -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;