summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Reininghaus <frank78ac@googlemail.com>2012-01-31 22:12:36 (GMT)
committerFrank Reininghaus <frank78ac@googlemail.com>2012-01-31 22:12:36 (GMT)
commit999234a94ae41cfb4f2167d2779b562ebf8127ce (patch)
tree27e9fea04a8a3e3708220e99b6368daf6a2afd15
parent0da05a975be2e4d04cd717684be4f4f5b5ac5e69 (diff)
Fix keyboard navigation issue when Home or End are pressed
The problem was that m_keyboardAnchorIndex and m_keyboardAnchorPos were not updated when Home or End are pressed. This causes the following unexpected behavior in Icons View: Press Home, then Right, then Down, then Home, finally Down. One would expect that the first item in the second row is the current item then, but before this commit, it was the second one because the controller still remembered that the second column was active before Home was pressed. FIXED-IN: 4.8.1
-rw-r--r--dolphin/src/kitemviews/kitemlistcontroller.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/dolphin/src/kitemviews/kitemlistcontroller.cpp b/dolphin/src/kitemviews/kitemlistcontroller.cpp
index bd37aa9..e3210dd 100644
--- a/dolphin/src/kitemviews/kitemlistcontroller.cpp
+++ b/dolphin/src/kitemviews/kitemlistcontroller.cpp
@@ -216,10 +216,14 @@ bool KItemListController::keyPressEvent(QKeyEvent* event)
switch (key) {
case Qt::Key_Home:
index = 0;
+ m_keyboardAnchorIndex = index;
+ m_keyboardAnchorPos = keyboardAnchorPos(index);
break;
case Qt::Key_End:
index = itemCount - 1;
+ m_keyboardAnchorIndex = index;
+ m_keyboardAnchorPos = keyboardAnchorPos(index);
break;
case Qt::Key_Left: