X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/b60da9b67acbfe94e43bd631e4e685f366d53ec5..c91c770ef1a60e7966048ece0ebfe861c8b288d1:/src/dolphincolumnwidget.cpp diff --git a/src/dolphincolumnwidget.cpp b/src/dolphincolumnwidget.cpp index c552d70e1..a9b0b8244 100644 --- a/src/dolphincolumnwidget.cpp +++ b/src/dolphincolumnwidget.cpp @@ -77,7 +77,7 @@ DolphinColumnWidget::DolphinColumnWidget(QWidget* parent, setVerticalScrollMode(QListView::ScrollPerPixel); setHorizontalScrollMode(QListView::ScrollPerPixel); - + new DolphinViewAutoScroller(this); // apply the column mode settings to the widget @@ -146,7 +146,7 @@ DolphinColumnWidget::DolphinColumnWidget(QWidget* parent, connect(KGlobalSettings::self(), SIGNAL(kdisplayFontChanged()), this, SLOT(updateFont())); - + FolderExpander* folderExpander = new FolderExpander(this, m_proxyModel); folderExpander->setEnabled(DolphinSettings::instance().generalSettings()->autoExpandFolders()); connect (folderExpander, SIGNAL(enterDir(const QModelIndex&)), @@ -421,7 +421,7 @@ void DolphinColumnWidget::wheelEvent(QWheelEvent* event) event->ignore(); return; } - + const int height = m_decorationSize.height(); const int step = (height >= KIconLoader::SizeHuge) ? height / 10 : (KIconLoader::SizeHuge - height) / 2; verticalScrollBar()->setSingleStep(step); @@ -447,6 +447,14 @@ void DolphinColumnWidget::selectionChanged(const QItemSelection& selected, const selModel->select(deselected, QItemSelectionModel::Deselect); } +void DolphinColumnWidget::currentChanged(const QModelIndex& current, const QModelIndex& previous) +{ + QListView::currentChanged(current, previous); + if (current.isValid()) { + scrollTo(current); + } +} + void DolphinColumnWidget::slotEntered(const QModelIndex& index) { m_view->m_controller->setItemView(this);