]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/dolphinview.cpp
Move the Ctrl-wheel zoom handling to dolphinview.
[dolphin.git] / src / dolphinview.cpp
index 7d3fea96a85fd70b48a3018cce02f589ecba6336..3fec8fdfb0d3087a0eb943f6e35a3ab8005658df 100644 (file)
@@ -537,6 +537,20 @@ void DolphinView::mouseReleaseEvent(QMouseEvent* event)
     QWidget::mouseReleaseEvent(event);
     setActive(true);
 }
+
+void DolphinView::wheelEvent(QWheelEvent* event)
+{
+    if ((event->modifiers() & Qt::ControlModifier) == Qt::ControlModifier) {
+        int d = event->delta();
+        if (d > 0 && isZoomInPossible()) {
+            zoomIn();
+        } else if (d < 0 && isZoomOutPossible()) {
+            zoomOut();
+        }
+       event->accept();
+    }
+}
+
 void DolphinView::activate()
 {
     setActive(true);