m_enableScrollTo(false),
m_controller(controller),
m_selectionManager(0),
+ m_autoScroller(0),
m_categoryDrawer(0),
m_font(),
m_decorationSize(),
viewport()->setAcceptDrops(true);
setMouseTracking(true);
- new DolphinViewAutoScroller(this);
+ m_autoScroller = new DolphinViewAutoScroller(this);
connect(this, SIGNAL(clicked(const QModelIndex&)),
controller, SLOT(requestTab(const QModelIndex&)));
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
m_controller->emitViewportEntered();
}
+void DolphinIconsView::currentChanged(const QModelIndex& current, const QModelIndex& previous)
+{
+ KCategorizedView::currentChanged(current, previous);
+ if (current.isValid() && !m_autoScroller->isActive()) {
+ scrollTo(current);
+ }
+}
+
void DolphinIconsView::slotShowPreviewChanged()
{
const DolphinView* view = m_controller->dolphinView();