tmf: Change time graph mouse wheel behavior
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / widgets / timegraph / widgets / TimeGraphControl.java
index 8b433a8ec612417d0c95ad6820303eeacc1aae71..12d4594070d667cbb4fd015c1e3fd1721fbd7d49 100644 (file)
@@ -2356,13 +2356,25 @@ public class TimeGraphControl extends TimeGraphBaseControl
         if (p.x >= 0 && p.x < parentSize.x && p.y >= 0 && p.y < parentSize.y) {
             // over the parent control
             if (e.x > getCtrlSize().x) {
-                // over the horizontal scroll bar
+                // over the vertical scroll bar
                 zoomScroll = false;
-            } else if (e.y >= 0 && e.y < getCtrlSize().y && e.x < fTimeProvider.getNameSpace()) {
-                // over the name space
-                zoomScroll = false;
-            } else {
+            } else if (e.y < 0 || e.y >= getCtrlSize().y) {
+                // over the time scale or horizontal scroll bar
                 zoomScroll = true;
+            } else {
+                if (e.x < fTimeProvider.getNameSpace()) {
+                    // over the name space
+                    zoomScroll = false;
+                } else {
+                    // over the state area
+                    if ((e.stateMask & SWT.MODIFIER_MASK) == SWT.CTRL) {
+                        // over the state area, CTRL pressed
+                        zoomScroll = true;
+                    } else {
+                        // over the state area, CTRL not pressed
+                        zoomScroll = false;
+                    }
+                }
             }
         }
         if (zoomScroll && fTimeProvider.getTime0() != fTimeProvider.getTime1()) {
This page took 0.024557 seconds and 5 git commands to generate.