┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/kitemviews
diff options
context:
space:
mode:
authorFrank Reininghaus <[email protected]>2012-01-31 23:12:36 +0100
committerFrank Reininghaus <[email protected]>2012-01-31 23:12:36 +0100
commit17e71420b6eb45c89a768498b38ba6480b30f3d1 (patch)
tree3778319fbba734e97d2c8e8b5ac1c2890268852c /src/kitemviews
parentd80e9db9fb801bb5230c5b80190e5630bd738823 (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
Diffstat (limited to 'src/kitemviews')
-rw-r--r--src/kitemviews/kitemlistcontroller.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp
index bd37aa964..e3210dd22 100644
--- a/src/kitemviews/kitemlistcontroller.cpp
+++ b/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: