- const QBrush& brush = m_viewOptions.palette.brush(QPalette::Normal, QPalette::Highlight);
- DolphinController::drawHoverIndication(viewport(), m_dropRect, brush);
+ const QBrush& brush = viewOptions().palette.brush(QPalette::Normal, QPalette::Highlight);
+ DragAndDropHelper::drawHoverIndication(this, m_dropRect, brush);
+ }
+}
+
+void DolphinIconsView::keyPressEvent(QKeyEvent* event)
+{
+ KCategorizedView::keyPressEvent(event);
+
+ const QItemSelectionModel* selModel = selectionModel();
+ const QModelIndex currentIndex = selModel->currentIndex();
+ const bool trigger = currentIndex.isValid()
+ && (event->key() == Qt::Key_Return)
+ && (selModel->selectedIndexes().count() <= 1);
+ if (trigger) {
+ triggerItem(currentIndex);
+ }
+}
+
+void DolphinIconsView::wheelEvent(QWheelEvent* event)
+{
+ KCategorizedView::wheelEvent(event);
+
+ // if the icons are aligned left to right, the vertical wheel event should
+ // be applied to the horizontal scrollbar
+ const IconsModeSettings* settings = DolphinSettings::instance().iconsModeSettings();
+ const bool scrollHorizontal = (event->orientation() == Qt::Vertical) &&
+ (settings->arrangement() == QListView::LeftToRight);
+ if (scrollHorizontal) {
+ QWheelEvent horizEvent(event->pos(),
+ event->delta(),
+ event->buttons(),
+ event->modifiers(),
+ Qt::Horizontal);
+ QApplication::sendEvent(horizontalScrollBar(), &horizEvent);