[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kde-baseapps] dolphin/src/kitemviews: Fix keyboard navigation issue when Home or End are pressed
From:       Frank Reininghaus <frank78ac () googlemail ! com>
Date:       2012-01-31 22:53:39
Message-ID: 20120131225339.35D96A60A6 () git ! kde ! org
[Download RAW message or body]

Git commit d03f1357c0509ea5204b578f40ccc203e7d5ee40 by Frank Reininghaus.
Committed on 31/01/2012 at 23:12.
Pushed by freininghaus into branch 'master'.

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.
(cherry picked from commit 999234a94ae41cfb4f2167d2779b562ebf8127ce)

M  +4    -0    dolphin/src/kitemviews/kitemlistcontroller.cpp

http://commits.kde.org/kde-baseapps/d03f1357c0509ea5204b578f40ccc203e7d5ee40

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:


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic