mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-19 16:31:21 +00:00
Improve arrow key navigation in Details View with expanded folders
If the current folder is collapsed, pressing the left arrow key now moves the focus to the parent folder. BUG: 300582 FIXED-IN: 4.8.4
This commit is contained in:
parent
70512f5081
commit
93daadae28
|
@ -231,7 +231,15 @@ bool KItemListController::keyPressEvent(QKeyEvent* event)
|
|||
|
||||
case Qt::Key_Left:
|
||||
if (index > 0) {
|
||||
--index;
|
||||
const int expandedParentsCount = m_model->expandedParentsCount(index);
|
||||
if (expandedParentsCount == 0) {
|
||||
--index;
|
||||
} else {
|
||||
// Go to the parent of the current item.
|
||||
do {
|
||||
--index;
|
||||
} while (index > 0 && m_model->expandedParentsCount(index) == expandedParentsCount);
|
||||
}
|
||||
m_keyboardAnchorIndex = index;
|
||||
m_keyboardAnchorPos = keyboardAnchorPos(index);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue