]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphiniconsview.cpp
Move the Ctrl-wheel zoom handling to dolphinview.
[dolphin.git] / src / dolphiniconsview.cpp
index ccf12a737d55fb986f701a80e81eea21943bd237..ccf4cbfc5163b05c4370f3099da9f0c8903ed694 100644 (file)
@@ -297,29 +297,24 @@ void DolphinIconsView::keyPressEvent(QKeyEvent* event)
 
 void DolphinIconsView::wheelEvent(QWheelEvent* event)
 {
-    KCategorizedView::wheelEvent(event);
-
+    // let Ctrl+wheel events propagate to the DolphinView for icon zooming
     if ((event->modifiers() & Qt::ControlModifier) == Qt::ControlModifier) {
-        int d = event->delta();
-        if (d > 0) {
-            zoomIn();
-        } else if (d < 0) {
-            zoomOut();
-        }
-    } else {
-        // 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);
-        }
+        event->ignore();
+       return;
+    }
+    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);
     }
 }