X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/148282e2d856b47ceb191eeef4c834118c8cdffd..c91c770ef1a60e7966048ece0ebfe861c8b288d1:/src/dolphiniconsview.cpp diff --git a/src/dolphiniconsview.cpp b/src/dolphiniconsview.cpp index b95de351a..2e43656ba 100644 --- a/src/dolphiniconsview.cpp +++ b/src/dolphiniconsview.cpp @@ -277,10 +277,10 @@ void DolphinIconsView::wheelEvent(QWheelEvent* event) event->ignore(); return; } - + horizontalScrollBar()->setSingleStep(m_itemSize.width() / 10); verticalScrollBar()->setSingleStep(m_itemSize.height() / 10); - + KCategorizedView::wheelEvent(event); // if the icons are aligned left to right, the vertical wheel event should // be applied to the horizontal scrollbar @@ -314,6 +314,14 @@ void DolphinIconsView::leaveEvent(QEvent* event) m_controller->emitViewportEntered(); } +void DolphinIconsView::currentChanged(const QModelIndex& current, const QModelIndex& previous) +{ + KCategorizedView::currentChanged(current, previous); + if (current.isValid()) { + scrollTo(current); + } +} + void DolphinIconsView::slotShowPreviewChanged() { const DolphinView* view = m_controller->dolphinView();