]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Zoom in and out the icon view on Ctrl+Mouse wheel.
authorLuciano Montanaro <mikelima@cirulla.net>
Fri, 1 Feb 2008 22:33:06 +0000 (22:33 +0000)
committerLuciano Montanaro <mikelima@cirulla.net>
Fri, 1 Feb 2008 22:33:06 +0000 (22:33 +0000)
CCMAIL: peter.penz@gmx.atn
--This li.Ine, and those below, will be ignored--

M    src/dolphiniconsview.cpp

svn path=/trunk/KDE/kdebase/apps/; revision=769728

src/dolphiniconsview.cpp

index 9e4a2604b5cb51ea31f9a2cb4d40a10df3ab68cd..ccf12a737d55fb986f701a80e81eea21943bd237 100644 (file)
@@ -299,18 +299,27 @@ 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);
+    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);
+        }
     }
 }