From 7b679cc956d3a8ae5e069eecfe018919ce00b9a6 Mon Sep 17 00:00:00 2001 From: Peter Penz Date: Sun, 11 Dec 2011 19:20:39 +0100 Subject: [PATCH] Scroll the view when the current item has been changed We need now explicitly to scroll to the item when the current item has been changed, as this is not done automatically in the scope of KItemListView. BUG: 288745 FIXED-IN: 4.8.0 --- src/kitemviews/kitemlistcontroller.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp index 90127aa17..263841a85 100644 --- a/src/kitemviews/kitemlistcontroller.cpp +++ b/src/kitemviews/kitemlistcontroller.cpp @@ -314,8 +314,7 @@ void KItemListController::slotChangeCurrentItem(const QString& text, bool search int index; if (searchFromNextItem) { index = m_model->indexForKeyboardSearch(text, (currentIndex + 1) % m_model->count()); - } - else { + } else { index = m_model->indexForKeyboardSearch(text, currentIndex); } if (index >= 0) { @@ -323,6 +322,7 @@ void KItemListController::slotChangeCurrentItem(const QString& text, bool search m_selectionManager->clearSelection(); m_selectionManager->setSelected(index, 1); m_selectionManager->beginAnchoredSelection(index); + m_view->scrollToItem(index); } } -- 2.47.3